Client does not support authentication protocol requested by server; consider upgrading MySQL client

(1)问题
nodejs 连接 mysql 报错:Client does not support authentication protocol requested by server; consider upgrading MySQL client
(2)解决方法

  • 找到你的MySQL安装路径,进入bin目录下
    Client does not support authentication protocol requested by server; consider upgrading MySQL client_第1张图片
  • 在路径地址栏上输入cmd进入命令行
    Client does not support authentication protocol requested by server; consider upgrading MySQL client_第2张图片
  • 输入命令 mysql -u root -p
    Client does not support authentication protocol requested by server; consider upgrading MySQL client_第3张图片
  • 输入密码
    Client does not support authentication protocol requested by server; consider upgrading MySQL client_第4张图片
  • 依次输入2条命令
# 这里最后的root就是你修改后的密码,根据自己的需求更改
ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'root'; 
# 刷新权限
FLUSH PRIVILEGES;  

注:每一条命令执行完都出现了Query OK, 0 rows affected也就修改成功了,之后我们就可以正常连接了
Client does not support authentication protocol requested by server; consider upgrading MySQL client_第5张图片

你可能感兴趣的:(mysql,数据库)