今天在测试使用sqlyog或者navicat 去 连接MySQL8.0 的时候,出现如下报错提示:
ERROR 2059 (HY000): Authentication plugin 'caching_sha2_password' cannot be loaded: ÕÒ²»µ½Ö¸¶¨µÄÄ£¿é¡£
看样子是验证插件问题的,排查下:
代码语言:javascript复制SELECT `user`, `host`, `authentication_string`, `plugin` FROM mysql.user;
------------------ ----------- ------------------------------------------------------------------------ -----------------------
| user | host | authentication_string | plugin |
------------------ ----------- ------------------------------------------------------------------------ -----------------------
| archiver | % | $A$005$==t@l=SP'G{U[1})D8yLwA6ti2uHtmUKNuHxQSUggrBRMBR2CheCw0Oxad9 | caching_sha2_password |
| mysql.infoschema | localhost | *THISISNOTAVALIDPASSWORDTHATCANBEUSEDHERE | mysql_native_password |
| mysql.session | localhost | *THISISNOTAVALIDPASSWORDTHATCANBEUSEDHERE | mysql_native_password |
| mysql.sys | localhost | *THISISNOTAVALIDPASSWORDTHATCANBEUSEDHERE | mysql_native_password |
| root | localhost | $A$005$==t@l=SP'G{U[1})D8yLwA6ti2uHtmUKNuHxQSUggrBRMBR2CheCw0Oxad9 | caching_sha2_password |
------------------ ----------- ------------------------------------------------------------------------ -----------------------
5 rows in set (0.06 sec)
修改arhiver账号的密码验证插件类型:
代码语言:javascript复制ALTER USER 'archiver'@'%' IDENTIFIED WITH mysql_native_password BY 'archiver';
flush privileges;
再次看下,
代码语言:javascript复制SELECT `user`, `host`, `authentication_string`, `plugin` FROM mysql.user;
------------------ ----------- ------------------------------------------------------------------------ -----------------------
| user | host | authentication_string | plugin |
------------------ ----------- ------------------------------------------------------------------------ -----------------------
| archiver | % | *13D295FD7B8108ABBC89FCDDD342FFBFF5DA803C | mysql_native_password |
| mysql.infoschema | localhost | *THISISNOTAVALIDPASSWORDTHATCANBEUSEDHERE | mysql_native_password |
| mysql.session | localhost | *THISISNOTAVALIDPASSWORDTHATCANBEUSEDHERE | mysql_native_password |
| mysql.sys | localhost | *THISISNOTAVALIDPASSWORDTHATCANBEUSEDHERE | mysql_native_password |
| root | localhost | $A$005$==t@l=SP'G{U[1})D8yLwA6ti2uHtmUKNuHxQSUggrBRMBR2CheCw0Oxad9 | caching_sha2_password |
------------------ ----------- ------------------------------------------------------------------------ -----------------------
5 rows in set (0.06 sec)
我们再用sqlyog 连接,发现是可以使用了。。