1.通过命令 select user,plugin from user where user='root'; 我们可以发现加密方式是caching_sha2_password。

2. 修改查看加密方式alter user 'root'@'%' identified with mysql_native_password by 'your password';your password这里填自己的mysql密码


3.
my.cnf文件添加:
default_authentication_plugin=mysql_native_password


4.重启服务

5.连接成功:
