美文网首页
mysql@2.18.1@mysql/lib/protocol/

mysql@2.18.1@mysql/lib/protocol/

作者: 坏坏坏坏_3a9f | 来源:发表于2020-05-26 10:41 被阅读0次

报错主要信息:

D:\projects\nodejs\blog-1\node_modules\_mysql@2.17.1@mysql\lib\protocol\Parser.js:437
      throw err; // Rethrow non-MySQL errors
      ^
Error: ER_NOT_SUPPORTED_AUTH_MODE: Client does not support authentication protocol requested by server; consider upgrading MySQL client
flush privileges;

image.gif

解决方法:

// 进入mysql 输入密码例如:123456
mysql -u root -p 

// 1.执行语句 alter user 'root'@'localhost' identified with mysql_native_password by 密码;
mysql> alter user 'root'@'localhost' identified with mysql_native_password by '123456';
Query OK, 0 rows affected (0.43 sec)

// 2.再执行语句 flush privileges;
mysql> flush privileges;
Query OK, 0 rows affected (0.05 sec)

//3.成功后 退出
mysql> quit
Bye
image.gif

nodejs环境重启下即可 npm run dev

原因:

MySQL8.0.4之前,MySQL的密码认证插件是

“mysql_native_password”,而以后版本使用的是“caching_sha2_password”。所以node会密码认证失败

相关文章

网友评论

      本文标题:mysql@2.18.1@mysql/lib/protocol/

      本文链接:https://www.haomeiwen.com/subject/pdjmahtx.html