[英]NodeJS MySQL Client does not support authentication protocol
When I am trying to connect with mysql 8.0 I am getting this error.当我尝试连接 mysql 8.0 时出现此错误。 How can I fix this?我怎样才能解决这个问题?
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
Try change the password as below:尝试更改密码如下:
ALTER USER 'root'@'localhost' IDENTIFIED BY 'your new password';
ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'your new password';
ALTER USER 'root'@'localhost' IDENTIFIED BY 'password';
ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'password';
FLUSH PRIVILEGES;
"password" is that you have to change the password you already have or you will modify it for a new one “密码”是您必须更改您已有的密码,否则您将修改为新密码
You're probably using mysql
npm package which currently doesn't support MySQL 8.0 new default authentication plugin caching_sha2_password.. You can just update your npm package to mysql2 : const mysql = require('mysql2')
您可能正在使用mysql
const mysql = require('mysql2')
package ,目前不支持MySQL 8.0新的默认违约插件插件caching_sha2_pallword ..
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.