打开APP
userphoto
未登录

开通VIP,畅享免费电子书等14项超值服

开通VIP
PHP连接mysql8.0出错“SQLSTATE[HY000] [2054] The server requested authentication method unknow.....

这个错可能是mysql默认使用 caching_sha2_password
作为默认的身份验证插件,而不再是 mysql_native_password
,但是客户端暂时不支持这个插件导致的。

解决方法一:修改MySQL全局配置文件

编辑 my.cnf
文件,更改默认的身份认证插件。

$ vi /etc/my.cnf

在 [mysqld]
中添加下边的代码

default_authentication_plugin=mysql_native_password

然后重启mysql

$ service mysqld restart

 

本站仅提供存储服务,所有内容均由用户发布,如发现有害或侵权内容,请点击举报
打开APP,阅读全文并永久保存 查看更多类似文章
猜你喜欢
类似文章
【热】打开小程序,算一算2024你的财运
php连接mysql时报错:SQLSTATE[HY000] [2002] No such file or directory
Navicat连接MySQL Server8.0版本时出现Client does not support authentication protocol requested by server;解决如下
[解决方案]SQLSTATE[HY000]: General error: 2006 My...
1251 - Client does not support authentication protocol requested by server; consider upgrading MySQL
服务器错误代码和消息
declare handler 声明异常处理的语法
更多类似文章 >>
生活服务
热点新闻
分享 收藏 导长图 关注 下载文章
绑定账号成功
后续可登录账号畅享VIP特权!
如果VIP功能使用有故障,
可点击这里联系客服!

联系客服