MySQL 连接出现 Authentication plugin ‘caching_sha2_password‘ cannot be loaded 的解决
使用Navicat Premium 12连接高版本的MySQL数据库时会出现Authentication plugin ‘caching_sha2_password’ cannot be loaded的错误。因为mysql8 之前的版本中加密规则是mysql_native_password,而在mysql8之后,加密规则是caching_sha2_password用root进入mysql控制台my
·
使用Navicat Premium 12连接高版本的MySQL数据库时会出现Authentication plugin ‘caching_sha2_password’ cannot be loaded的错误。
因为mysql8 之前的版本中加密规则是mysql_native_password,而在mysql8之后,加密规则是caching_sha2_password
注意高版本的先查询看看你的用户的加密规则,还有他对应的host,不要盲目复制网上的语句!
用root进入mysql控制台
mysql -h localhost -u root -p
查看用户的密码规则,及对应host
use mysql;
select user, host, plugin from user;
注意看你的用户的host!
修改加密规则及密码(注意:下面的 % 是对应上图的host)
ALTER USER 'root'@'%' IDENTIFIED WITH mysql_native_password BY '替换成你的密码';
再查看下是否改成了
select user, host, plugin from user;
用navicat连接,OK!
更多推荐
已为社区贡献3条内容
所有评论(0)