Mysql_新建连接报错:Client does not support authentication protocol requested by server ;consider upgrading Mysql client

时间:2020-10-27 10:59:22   收藏:0   阅读:35

Mysql_新建连接报错:Client does not support authentication protocol requested by server ;consider upgrading Mysql client

技术图片

 

 

原因:

上网搜索解决方案,网上说出现这种情况的原因是:mysql8 之前的版本中加密规则是mysql_native_password,而在mysql8之后,加密规则是caching_sha2_password, 

 

解决方法:

1、进入Mysql服务端:

    输入mysql -u root -p,输入密码进入

    技术图片

 2、继续输入:

ALTER USER ‘root‘@‘127.0.0.1‘ IDENTIFIED BY ‘password‘ PASSWORD EXPIRE NEVER; #修改加密规则 (这行我没有写,不过貌似也可以)

ALTER USER ‘root‘@‘127.0.0.1‘ IDENTIFIED WITH mysql_native_password BY ‘你自己的密码‘; #更新一下用户的密码 

FLUSH PRIVILEGES; #刷新权限

 

评论(0
© 2014 mamicode.com 版权所有 京ICP备13008772号-2  联系我们:gaon5@hotmail.com
迷上了代码!