SQLSTATE[HY000] [2054] The server requested authentication method unknown to the client (SQL: select * from admin_users where username = **and status = 1 limit 1)

背景

laravel 5.5.49 框架使用 mysql 8.0,本地使用 docker 起了一个 mysql8.0 服务,配置与 mysql5.7 一样

  • 登录网站后台直接报错,SQLSTATE[HY000] [2054] The server requested authentication method unknown to the client (SQL: select * from admin_users where username = XX and status = 1 limit 1)

排查及解决方案:

  • navicat 连接正常


  • 解决方案
# 进入mysql容器修改,并重启,成功
 ALTER USER 'root'@'%' IDENTIFIED WITH mysql_native_password BY '*******';
posted @ 2021-03-06 17:32  _DongGe  阅读(730)  评论(0)    收藏  举报