Authentication plugin 'caching_sha2_password' cannot be loaded
8.0 默认采用新的加密方式:caching_sha2_password,会导致8.0以下版本的客户端连接不上
ERROR 2059 (HY000): Authentication plugin 'caching_sha2_password' cannot be loaded: /data/mysql/lib/plugin/caching_sha2_password.so: cannot open shared object file: No such file or directory
问题分析:
MySQL 8.0之前,default_authentication_plugin 参数值为 mysql_native_password,该插件基于SHA-1算法。
MySQL 8.0中,default_authentication_plugin 参数值修改为 caching_sha2_password,该插件基于SHA-256算法。
解决办法:
方法一:修改用户显示指定 auth_plugin 为 mysql_native_password
mysql> ALTER USER `root`@`%` IDENTIFIED WITH mysql_native_password BY "Jimstars";
mysql> FLUSH PRIVILEGES;
方法二:修改参数default_authentication_plugin 为 mysql_native_password
default_authentication_plugin = mysql_native_password
方法三:升级MySQL客户端或驱动。
浙公网安备 33010602011771号