mysql8.4版本mysql_native_password无法连接问题处理

时间:2025-01-25 07:32:49

mysql8.4版本mysql_native_password无法连接问题处理

用dbeaver可以直接连接

用NAVICAT连接后报错

  • 在网上查找8.0版本可以在里[mysqld]配置以下描述
    default_authentication_plugin=mysql_native_password
  • 仍然报错,翻文档发现In MySQL 8.4, the mysql_native_password server-side plugin is disabled by default.,也就是不允许这么配置了

解决方案

  • 但文档给出了另一种方案,在mysqld设置mysql_native_password=ON,实测可用
    改完后用管理员身份打开命令提示符重启mysl即可
net stop mysql
net start mysql
mysql -uroot -p
-- 输入密码
alter user 'root'@'localhost' identified with mysql_native_password;
alter user 'root'@'localhost' identified by '123456';
  • 如果不设置,则在修改账号验证方式时会报错ERROR 1524 (HY000): Plugin ‘mysql_native_password’ is not loaded