Mysql连接报错解决方案

发布时间 2023-11-30 21:33:03作者: 乐 乐——1128

错误:Reading from the stream has failed.

解决方案1:
添加SslMode=None

解决方案2:
找到开始菜单下mysql目录下的cmd程序,如图:

 

1、数据库用户的加密方式里已经是mysql_native_password,但远程链接时依旧提示
Authentication to host"11.xx.x.xxx for user’ejdwhwdas’usingmethod caching_sha2-password’failed with message: Readingfrom the stream has failed

问题原因:
1、只执行了alter user ‘root’@’指定IP’ identified with mysql_native_password by ‘1234’;

解决方式
完整的步骤:
1、ALTER USER ‘root’@‘指定IP’ IDENTIFIED BY ‘password’ PASSWORD EXPIRE NEVER; #修改加密规则
2、ALTER USER ‘root’@‘指定IP’ IDENTIFIED WITH mysql_native_password BY ‘1234’; #更新一下用户的密码
3、FLUSH PRIVILEGES; #刷新权限