navicat链接Mysql8报错:2059 - authentication plugin ‘caching_sha2_password’ cannot be loaded…
-
-
问题原因
这是因为 mysql 8 之前密码加密规则为 mysql_native_password,而 MySQL8 之后的加密规则为 caching_sha2_password,也就是说,只需要将 密码规则 改回 mysql_native_password 即可;8.0 以前的默认身份验证插件是 mysql_native_password
8.0 以后的默认身份验证插件是 caching_sha2_password -
解决办法
- 第一步:进入mysql
- 第二步:
- 第三步:
- 第四步:更改加密方式
- 第五步
- 第一步:进入mysql
PS
如果是远程连接root的host是%,则需要将
alter user ‘root’@‘localhost’ identified by ‘root’ password expire never;改为
alter user ‘root’@’%’ identified by ‘root’ password expire never;
同理
alter user ‘root’@‘localhost’ identified with mysql_native_password by ‘root’;改为
alter user ‘root’@’%’ identified with mysql_native_password by ‘root’;