[Mysql 8.0报错] Error: ER_NOT_SUPPORTED_AUTH_MODE: Client does not support authentication protocol requested by server; consider upgrading MySQL client

起因

想搭建一个 API 服务器,导入数据库数据后正准备使用 node 启动发现了一个问题

Error: ER_NOT_SUPPORTED_AUTH_MODE: Client does not support authentication protocol requested by server; consider upgrading MySQL client

通过万恶的翻译了解到这是因为 mysql8.0 加密方式报错
查阅资料后解决,记录一下

解决方法

打开终端,运行下列指令

mysql -u root -p
输入您的密码
use mysql;
alter user 'root'@'localhost' identified with mysql_native_password by '您的密码';
flush privileges;

之后就可以解决啦

点赞

发表评论

电子邮件地址不会被公开。必填项已用 * 标注