navicat连接mysql8:2059 authentication plugin 'caching_sha2_passord' can not be loaded

今天在电脑上安装了mysql8.0,用navicat连接的时候出现了如下的错误:

这是因为mysql 8.0 默认使用 caching_sha2_password 身份验证机制 —— 从原来的 mysql_native_password 更改为 caching_sha2_password。 从 5.7 升级 8.0 版本的不会改变现有用户的身份验证方法,但新用户会默认使用新的 caching_sha2_password 。

解决方法如下:

使用mysql自带的 MySQL 8.0 Command Line Client - Unicode 登录,

然后使用命令:alter user 'root'@'localhost' identified with mysql_native_password by 'root';进行密码的更新; 

Navicat再次连接,成功。

猜你喜欢

转载自www.cnblogs.com/sxy-code-blog/p/9192659.html