Linux访问MySQL出错
报错如下
Client does not support authentication protocol requested by server; consider upgrading MySQL client
全文信息
{
"code": -1,
"message": "用户名或密码不正确",
"data": {
"code": "ER_NOT_SUPPORTED_AUTH_MODE",
"errno": 1251,
"sqlMessage": "Client does not support authentication protocol requested by server; consider upgrading MySQL client",
"sqlState": "08004",
"fatal": true
}
}
当天在做nodejs后端时,访问数据库出现错误
解决方法
# 修改下密码
ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY '你的密码';
# 刷新权限
FLUSH PRIVILEGES;
问题解决了