navicat连接mysql报错如下:
2059 - Authentication plugin 'caching_sha2_password' cannot be loaded: dlopen(../Frameworks/caching_sha2_password.so, 2): image not found
原因:由于目前已有的客户端连接软件还不支持mysql 8新增加的加密方式caching_sha2_password
,所以我们需要修改用户的加密方式,将其改为老的加密验证方式。
use mysql;
select user,plugin from user where user='root';
+------+-----------------------+
| user | plugin |
+------+-----------------------+
| root | caching_sha2_password |
| root | caching_sha2_password |
+------+-----------------------+
2 rows in set (0.00 sec)
可以看到加密方式为caching_sha2_password
更改需要通过远程连接的用户的加密方式为mysql_native_password
即可,这里用root用户举例:
-- 更改用户加密方式
alter user 'root'@'%' identified with mysql_native_password by '123456';
-- 刷新配置环境
flush privileges;
再次远程登录即可正常连接