mysql报错
Unhandled rejection Error: Error: ER_NOT_SUPPORTED_AUTH_MODE: Client does not support authentication protocol requested b
y server; consider upgrading MySQL client
解决办法
修改加密规则为普通模式,默认是严格加密模式
- 进入mysql控制面板,输入
mysql -uroot -p
,输入密码 - 在控制面板上依次输入
- 修改加密规则
ALTER USER 'root'@'localhost' IDENTIFIED BY 'password' PASSWORD EXPIRE NEVER;
- 更新用户密码
ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'password';
- 刷新权限
FLUSH PRIVILEGES;
- 输入刚刚修改的密码,再次测试连接即可。
参考:mysql8.0版本 报错:Error: ER_NOT_SUPPORTED_AUTH_MODE: Client does not support authentication protocol...