nodejs mysql客户端不支持身份验证协议

ojsjcaue  于 2021-06-21  发布在  Mysql
关注(0)|答案(2)|浏览(421)

当我尝试连接mysql 8.0时,我遇到了这个错误。我怎样才能解决这个问题?

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
vfh0ocws

vfh0ocws1#

请尝试按以下方式更改密码:

ALTER USER 'root'@'localhost' IDENTIFIED BY 'your new password'; 
ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'your new password';
izkcnapc

izkcnapc2#

ALTER USER 'root'@'localhost' IDENTIFIED BY 'password'; 
ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'password';

FLUSH PRIVILEGES;

“密码”是指你必须改变你已经拥有的密码,否则你将修改它为一个新的

相关问题