client does not support consider.....upgading MYSQL client问题解决

编程知识 更新时间:2023-05-02 05:32:49

client does not support consider.....upgading MYSQL client问题解决

        • 一、报错的原因
        • 二、修改root加密方式为mysql_native_password:
        • 三、发现没生效,查看root用户有两条记录:
        • 四、修改root@%的加密方式
        • 五、查看user表是否修改成功:
        • 六、测试连接

MySQL是安装在虚拟机的,版本是8.0.22,本机使用SQLYog连接时,提示如下报错:

网上翻了一遍资料查看,都说执行以下两条命令都可以解决:

 alter user 'root'@'localhost' identified with mysql_native_password by '123456';
 flush privileges;

但修改之后发现还是不行。以下是自行摸索得到的解决步骤:

一、报错的原因

因为MySQL8.0以上版本使用的密码加密方式发生了改变,使用的是caching_sha2_password,而SQLYog客户端使用的还是mysql_native_password加密方式连接。可以通过查看user表可以知道:

select user,plugin from mysql.user;

二、修改root加密方式为mysql_native_password:

alter user 'root'@'localhost' identified with mysql_native_password by 'root';
flush privileges;

三、发现没生效,查看root用户有两条记录:

select user,plugin,host from mysql.user;

其中,host为%表示,表示的远程登录,并且是除服务器外的其他任何终端;
host为%表示localhost,表示可以在本地登录,即可以在服务器上登陆

而我使用的是windows的SQLYog连接虚拟机的Mysql,使用的root应该是host为%的root。而这个root的plugin还是caching_sha2_password,所以才导致了第二步并没有生效。

四、修改root@%的加密方式

mysql> alter user 'root'@'localhost' identified with caching_sha2_password by 'root';
Query OK, 0 rows affected (0.00 sec)
mysql> 
mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec)

五、查看user表是否修改成功:

六、测试连接


终于连上了!

更多推荐

client does not support consider.....upgading MYSQL client问题解决

本文发布于:2023-04-26 07:04:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/20f2dc161cc935501949b9eb62ceeb76.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:support   client   MYSQL   upgading

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!

  • 104624文章数
  • 26216阅读数
  • 0评论数