问题报错信息: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'@'%' ;

完成后,便可以实现账号的远程了。

Logo

为开发者提供学习成长、分享交流、生态实践、资源工具等服务,帮助开发者快速成长。

更多推荐