mysql8.0 报错:连接报错1251 client does no support authentic

[分析]:

因为mysql8.X系列账户的默认的认证加密方式是caching_sha2_password, 而5.7系列默认是mysql_native_password,所以在使用老版本的客户端驱动连接Mysql时会报不支持的认证协议。

[解决]

  • 方案一、更改一下默认的认证方式为mysql_native_password

1、查看账户的认证加密方式:

[root@k8s-node4 ~]# mysql -uroot -p
mysql> select host,user,plugin from user;
+-----------+---------------+-----------------------+
| host      | user          | plugin                |
+-----------+---------------+-----------------------+
| localhost | root          | caching_sha2_password |
| localhost | mysql.session | caching_sha2_password |
| localhost | mysql.sys     | caching_sha2_password |
| %         | root          | caching_sha2_password |
| %         | xdba          | caching_sha2_password |
+-----------+---------------+-----------------------+

2、更改默认的认证方式为mysql_native_password

ALTER USER ‘root’@’%’ IDENTIFIED WITH mysql_native_password BY ‘123456’;

  • 方案二、升级更新客户端连接的mysql驱动

results matching ""

    No results matching ""