这两天又反复遇到这个问题,先写解决方案:
1. 使用 caching_sha2_password 插件
修改用户密码,并且用插件生成,可以解决 WordPress 的问题。
ALTER USER 'user'@'localhost' IDENTIFIED WITH caching_sha2_password BY 'password';
2. 修改 my.cnf,使用原生密码
使用 Laravel + MySQL 8.0 的时候,遇到
SQLSTATE[HY000] [2054] The server requested authentication method unknown to the client
修改 /etc/mysql/my.cnf (我是 Ubuntu 16.04),添加下面一行:
[mysqld]
default_authentication_plugin= mysql_native_password
然后重置密码:
ALTER USER 'user'@'localhost' IDENTIFIED WITH mysql_native_password BY 'password';
(更多…)