Unable to load authentication plugin ‘caching_sha2_password问题解决

问题

  Unable to load authentication plugin 'caching_sha2_password



原因

这是 mysql 8.0+ 版本才出现的问题,原因是 mysql 8.0 默认使用 caching_sha2_password 
身份验证机制,从原来的 mysql_native_password 更改为 caching_sha2_password

解决方法

    1.修改数据库的配置(推荐)
    2. 降低Mysql版本



解决步骤

1.左下角 cmd
2. mysql -uroot -p
3. root(你数据库的密码)

4. select user,plugin from mysql.user;

这里需要将caching_sha2_password 修改为 mysql_native_password
5. ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'root';(注意:最后的root是你的密码,我的密码是root)

alter user 'root'@'localhost' IDENTIFIED WITH mysql_native_password by 'root';

可以再次执行查询 select user,plugin from mysql.user;再看下是否修改成功(可不看) 我这这里已经修改成功

猜你喜欢

转载自blog.csdn.net/chenyu_Yang/article/details/140967197