当前位置: 代码迷 >> 综合 >> MySql错误 1251 - Client does not support authentication protocol requested by server解决办法
  详细解决方案

MySql错误 1251 - Client does not support authentication protocol requested by server解决办法

热度:39   发布时间:2023-12-24 18:19:25.0

原因是在mysql8之前的版本中加密规则为mysql_native_password
而在mysql8以后的加密规则为caching_sha2_password。

ALTER USER 'root'@'localhost' IDENTIFIED BY 'password' PASSWORD EXPIRE NEVER; #修改加密规则  
ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY '新密码';  #更新一下用户的密码  
FLUSH PRIVILEGES; #刷新权限
  相关解决方案