解决SQLyog连接MYSQL的错误 1251 - Client does not support
随心所欲的老顽童
编辑于 2023年03月21日 23:18

有时候使用SQLyog连接MYSQL的时候会报如下错误。

1251 - Client does not support authentication protocol requested by server; consider upgrading MySQL Client

错误原因是加密方式的问题

    MySql 8.0.11 换了新的身份验证插件(caching_sha2_password),

    而原来的身份验证插件为(mysql_native_password)。

只需要更改一下加密方式即可解决

首先执行如下SQL语句进入mysql数据库

mysql>use mysql;

执行如下SQL语句查看加密方式

mysql>select user, plugin from user where user= 'root&#​39;;

看到加密方式为caching_sha2_password。

执行如下SQL语句更改加密方式

mysql>alter user "root&#​34;@"localhost&#​34; identified with mysql_native_password by "(your password)&#​34;;

把(your password)替换成你的密码

再次执行

mysql>select user, plugin from user where user= 'root&#​39;;

看到加密方式已经改变

现在就可以去SQLyog里测试了