老程序连接mysql8.0权限问题:The server requested authentication method unknown to the client


今天弄了一个老版本的cms系统,尝试使用mysql8.0数据库,提示:The server requested authentication method unknown to the client。
权限问题,修改如下。

修改配置文件:

[mysqld]
default_authentication_plugin= mysql_native_password

执行命令:

FLUSH PRIVILEGES;

修改已有用户的密码:

ALTER USER $user IDENTIFIED WITH mysql_native_password BY 'passwd'

本地测试环境使用的是root:

ALTER USER 'root'@'%' IDENTIFIED WITH mysql_native_password BY '123';

Archives