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

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; #刷新权限

原文地址:https://www.cnblogs.com/rychh/p/13878094.html