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 '*******';