nodejs mysql数据库远程登陆失败Client does not support authentication protocol requested by server; consider upgrading MySQL client

 

nodejs 远程登陆数据库时,报Client does not support authentication protocol requested by server; consider upgrading MySQL client错误

帐号密码没有任何问题。

=>解决办法

1. 登陆mysql数据库客户端

2.输入root密码

3.执行以下三条命令

   use mysql;

   alter user 'root'@'localhost' identified with mysql_native_password by 'root';       //说明,此处root代码的是root的密码

   flush privileges;

然后再次连接就没有问题了。如果时其他帐号连接,对其他帐号执行相同操作。

 

posted @ 2019-08-06 13:43  liehuofeihu  阅读(215)  评论(0)    收藏  举报