MySQL连接navicat出现 2059 - authentication plugin ‘caching_sha2_password解决方法

今天给同学部署项目的时候用navicat登录的时候报错:2059 - authentication plugin 'caching_sha2_password解决方法。

出现的原因是:mysql8之前版本中加密规则为mysql_native_password

mysql8以后的加密规则为caching_sha2_password

将mysql用户登录加密规则修改为mysql_native_password即可!

1. 点击Window+R  cmd 进入doc

2.输入mysql -uroot -p 进行登录

3.输入你的数据库密码,正确后显示登陆成功 出现Welcome to the MySQL monitor.

4.输入use mysql; 出现Database changed

5.输入select user,host from user;

目的为了查看user的root 对应host是什么 我的对应为localhost

6.修改加密规则:输入ALTER USER ‘root’@‘localhost’ IDENTIFIED WITH mysql_native_password BY ‘root’;

然后重新用navicat进行登录连接即可:

猜你喜欢

转载自blog.csdn.net/weixin_39709134/article/details/127298012