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

原文地址:https://www.cnblogs.com/wangziyue/p/10642809.html

时间: 2024-08-30 07:55:18

PHP连接mysql8.0出错“SQLSTATE[HY000] [2054] The server requested authentication method unknow.....的相关文章

PHP错误:SQLSTATE[HY000] [2054] The server requested authentication method unknown to the client

使用PHP连接MySQL 8的时候,可能会发生如标题所示的错误: SQLSTATE[HY000] [2054] The server requested authentication method unknown to the client 发生这种错误,是由于MySQL 8默认使用了新的密码验证插件:caching_sha2_password,而之前的PHP版本中所带的mysqlnd无法支持这种验证.解决这个问题,有两种办法. 一种办法是升级PHP支持MySQL 8的新验证插件. PHP 7.

SQLSTATE[HY000] [2054] The server requested authentication method unknown to the client

安装 nextcloud 的时候选择的是 mysql ,在链接 mysql 的时候报错,信息如下: SQLSTATE[HY000] [2054] The server requested authentication method unknown to the client 搜索了下应该是 MySQL 8默认使用了新的密码验证插件:caching_sha2_password ,而有些 PHP 版本不支持这个问题造成的 解决办法: 修改登录用户的 plugin 为 mysql_native_pas

mysql 8.0 错误The server requested authentication method unknown to the client

mysql 安装了最新版本8.0.11后创建用户并授权后,授权的用户连接数据库提示 The server requested authentication method unknown to the client 查阅一些相关的资料后发现是由于新版本的mysql账号密码解锁机制不一致导致的 解决办法: 删除创建的用户和授权, 找到mysql配置文件并加入 default_authentication_plugin=mysql_native_password 变为原来的验证方式,然后从新创建用户并

远程连接MYSQL8.0服务器问题

title: 远程连接MYSQL8.0服务器问题 date: 2018-07-07 11:02:26 updated: tags: [MYSQL,坑] description: keywords: comments: image: --- 问题描述: 先前使用MYSQL5.1,远端访问MYSQL服务器没问题,遇到的问题也就是防火墙问题,修改出入站规则后轻松的解决了.但是MYSQL8.0就很坑了,按照网上的解决办法折腾了两个小时,最后解决,依然不明白哪里有问题,只能把操作复现,为以后使用留个记录.

【问题记录】Navicat Premium连接mysql-8.0.17时出现2059 - Authentication plugin 'caching_sha2_password’....错误

问题描述: Navicat Premium连接mysql-8.0.17时出现2059 - Authentication plugin 'caching_sha2_password’ cannot be loaded:......错误 问题分析: mysql8 之前的版本中加密规则是mysql_native_password,而在mysql8之后,加密规则是caching_sha2_password. 解决办法: 1.登陆数据库:mysql - u root -p; 2.切换数据库:use mys

PyCharm Community 2019.2 连接MySQL8.0 时区不同步的解决

Windows10中,PyCharm Community 2019.2  连接MySQL8.0 连接错误,IDE提示如下: Cannot connect to "MySQL8.0".The server time zone value 'Öйú±ê׼ʱ¼ä' is unrecognized or represents more than one time zone. You must configure either the server or JDBC driver (via

PDO连接mysql8.0报PDO::__construct(): Server sent charset (255) unknown to the client. Please, report to the developers错误

安装mysql8.0之后,尝试使用php连接mysql,总是报PDO::__construct(): Server sent charset (255) unknown to the client. Please, report to the developers错误,网上找了很多资料,然而都没有多大用处. 查找了mysql官方说明文档才知道原来M8.0已经已经把默认字符集升级成ut8mb4了,于是找到my.cnf文件,修改如下: 1 [client] 2 port = 3306 3 socke

远程连接mysql8.0,Error No.2058 Plugin caching_sha2_password could not be loaded

通过本地去连接远程的mysql时报错,原因时mysql8.0的加密方法变了. mysql8.0默认采用caching_sha2_password的加密方式 第三方客户端基本都不支持这种加密方式,只有自带的命令行支持 所以需要修改加密方式. 首先进入mysql命令行 [[email protected] ~]# mysql -u root -p Enter password: 第一步:修改加密方式 ALTER USER'root'@'localhost' IDENTIFIED BY '[email

Navicat11.1连接Mysql8.0报错1251的解决办法

今天下载mysql-8.0.13,完成配置及正常启动后,Navicat11.1工具连接时总报错:1251,找到解决办法主是要mysql8的加密方式不同.具体解决办法如下:一.管理员权限打开CMD,输入mysql的root帐号及密码: D:\mysql8>mysql -u root -p输入root的密码回车二.更改mysql的方式:mysql> ALTER USER 'root'@'localhost' IDENTIFIED BY 'password' PASSWORD EXPIRE NEVE