问题报错信息:Client does not support authentication protocol requested by server; consider upgrading MySQL client
图中翻译:客户端不支持服务器请求的认证协议;考虑升级mysql客户端
造成解决这个问题的原因是:Mysql 8.0 以后的版本账号密码加密规则是caching_sha2_password
Mysql 8.0之前的版本账号密码加密规则是mysql_native_password
所以解决方法为:
1、登录mysql数据库;
[root@localhost:~] mysql -uroot -p12345678
2、设置账号密码规则;
mysql> alter user 'root'@'localhost' identified with mysql_native_password by 'Jj@123.com';
如果出现以下报错:
则先输入下列
mysql> update user set host = '%' where user = 'root' and host='localhost';
mysql> grant all privileges on *.* to 'root'@'%' ;
完成后,便可以实现账号的远程了。