php连接mysql8,报错:
mysqli_connect(): The server requested authentication method unknown to the client [caching_sha2_password]
尝试修改mysql8的默认用户认证插件,在my.cnf中追加配置:
default_authentication_plugin=mysql_native_password
重启mysql并查询:
SHOW VARIABLES LIKE 'default_authentication_plugin';
结果显示mysql使用的默认用户认证插件仍然是:caching_sha2_password
为何配置没有生效?如何设置mysql8的默认用户认证方式呢?
补充
我也修改了用户的认证方式:
但是仍然报同样的错误。