The server requested authentication method unknown to the client

女爷i 2023-02-11 09:00 109阅读 0赞

mysql 安装了最新版本8.0.20后创建用户并授权后,授权的用户连接数据库提示:

The server requested authentication method unknown to the client

这是由于php的mysqld拓展不支持caching_sha2_password加密方式:
在这里插入图片描述
只需要改一下登陆账号的认证方式即可:

  1. ALTER USER 'root'@'%' IDENTIFIED WITH mysql_native_password BY '你的密码';

如果想要后面默认就是用这种方式,需要修改配置文件:

vim /etc/my.cnf

  1. default_authentication_plugin=mysql_native_password

发表评论

表情:
评论列表 (有 0 条评论,109人围观)

还没有评论,来说两句吧...

相关阅读