阅读:1594回复:0
[nodejs]bug:ER_NOT_SUPPORTED_AUTH_MODE: Client does not support authentication protocol requested by server
问题:
在部署node+js项目时,调用接口出现了如下错误提示: ER_NOT_SUPPORTED_AUTH_MODE: Client does not support authentication protocol requested by server; consider upgrading MySQL client 原因: 最新的mysql模块并未完全支持MySQL 8的“caching_sha2_password”加密方式,而“caching_sha2_password”在MySQL 8中是默认的加密方式。因此,下面的方式命令是默认已经使用了“caching_sha2_password”加密方式,该账号、密码无法在mysql模块中使用。 解决方案: 修改加密方式。 1、use mysql; 2、alter user 'root'@'localhost' identified with mysql_native_password by '你的数据库密码'; 3、flush privileges; 注:如果采用的是命令行窗口,确认是否是以管理员的身份打开。 |
|
|