PHP连接mysql8.0出错“SQLSTATE[HY000] [2054] The server requested authentication method unkno…
今天安装安装一个叫得推校园O2O系统的使劲都说连接不上服务器。
下面是安装说明,我直接进行3步骤,导入数据库配置文件,结果就显示题目报错的内容
安装说明: 直接输入程序目录即可 http://localhost/ 程序只支持站点根目录
安装问题说明:
.跳转不到安装目录
删除config/install.lock
.安装出现temp/caches不可写提示
查看目录是否存在,不存在则创建
设置目录拥有读写权限
.不能正常安装,一直停留在安装界面
可以直接导入install/xyo2o.sql,创建config/install.lock,更改config/config.php数据库配置
后台默认密码 admind admin 如果不是清空admin表
.访问出现请关闭全局变量
请在php.ini 中设置register_globals=off
.打不开网站
请删除.htaccess文件,或者配置伪静态
然后就是排错啊。找啊找原来我装的mysql是8.0的
错误信息
SQLSTATE[HY000] [] The server requested authentication method unknown to...
这个错可能是mysql默认使用 caching_sha2_password
作为默认的身份验证插件,而不再是 mysql_native_password
,但是客户端暂时不支持这个插件导致的。 官方文档说明
In MySQL 8.0, caching_sha2_password is the default authentication plugin rather than mysql_native_password. For information about the implications of this change for server operation and compatibility of the server with clients and connectors, see caching_sha2_password as the Preferred Authentication Plugin.
在MySQL 8.0中,caching_sha2_password是默认的身份验证插件,而不是mysql_native_password。有关此更改对服务器操作的影响以及服务器与客户端和连接器的兼容性的信息,请参阅caching_sha2_password作为首选身份验证插件。
解决方法一:修改MySQL全局配置文件
编辑 my.cnf
文件,更改默认的身份认证插件。
vi /etc/my.cnf
在 [mysqld]
中添加下边的代码
default_authentication_plugin=mysql_native_password
然后重启mysql
service mysqld restart
解决方法二:修改密码认证方式
ALTER USER 'YOURUSERNAME'@'localhost' IDENTIFIED WITH mysql_native_password BY 'YOURPASSWORD';
第一个方法我试了不行,我使用修改密码认证方式成功的。修改后再到网站首页创建数据库什么的就不会报错服务器连接失败了。还好我是直接导入数据库修改配置文件后她才能出现这个具体的报错。
参考链接:https://www.colabug.com/3497990.html
参考链接:https://www.lanrenzhijia.com/source/5299.html
PHP连接mysql8.0出错“SQLSTATE[HY000] [2054] The server requested authentication method unkno…的更多相关文章
- PHP连接mysql8.0出错“SQLSTATE[HY000] [2054] The server requested authentication method unknow.....
这个错可能是mysql默认使用 caching_sha2_password作为默认的身份验证插件,而不再是 mysql_native_password,但是客户端暂时不支持这个插件导致的. 解决方法一 ...
- mysql8.0:SQLSTATE[HY000] [2054] The server requested authentication method unknown to the client
忽然注意到的情况: 2018/7/19至2018/9/13之间发布的7.1.20.7.1.21.7.1.22和7.2.8.7.2.9.7.2.10这六个版本提供的对caching_sha2_passw ...
- PHP错误:SQLSTATE[HY000] [2054] The server requested authentication method unknown to the client
使用PHP连接MySQL 8的时候,可能会发生如标题所示的错误: SQLSTATE[HY000] [2054] The server requested authentication method u ...
- php7.3连接MySQL8.0报错 PDO::__construct(): The server requested authentication method unknown to the client [caching_sha2_password]
报的错误: In Connection.php line : SQLSTATE[HY000] [] The server requested authentication method unknown ...
- Laravel - 解决连接MySQL时报"The server requested authentication method unknown to the client”错误
2019-04-12发布:hangge阅读:934 1,问题描述 最近建了个 Laravel 项目,当配置好 MySQL 数据库进行请求时,页面报如下错误: SQLSTATE[HY000] [ ...
- mysql 8.0 错误The server requested authentication method unknown to the client
mysql 安装了最新版本8.0.11后创建用户并授权后,授权的用户连接数据库提示 The server requested authentication method unknown to the ...
- Navicat连接mysql8.0.1版本出现1251--Client does not support authentication protocol requested by server的解决
转载自:https://blog.csdn.net/XDMFC/article/details/80263215 好不容易安装好mysql,但又出现了mysql客户端版本太低的问题.根据参考的这篇博客 ...
- Docker mysql 连接 “The server requested authentication method unknown to the clien”错误
查了下,出现这个错误的原因是从mysql 5.6开始,mysql密码加密算法更改了. 我装的mysql 8.* ,那么有两种解决方法: mysql 版本选择 <= 5.6 修改密码 docker ...
- 远程连接MYSQL8.0服务器问题
title: 远程连接MYSQL8.0服务器问题 date: 2018-07-07 11:02:26 updated: tags: [MYSQL,坑] description: keywords: c ...
随机推荐
- 1.7-BGP④
注意:默认路由ip route 0.0.0.0 0.0.0.0 12.1.1.1是不可以作为BGP邻居TCP始发连接的(但回包可以) 要配静态路由:ip route 13.1.1.3 255.255. ...
- [Angular] New in V6.1
Router Scroll Position Restoration: remember and restore scroll position as the user navigates aroun ...
- MapR CEO对2016大数据的5个预測
本文来源于我在InfoQ中文站翻译的文章,原文地址是:http://www.infoq.com/cn/news/2016/02/mapr-ceo-5-big-data-predictions MapR ...
- 【翻译自mos文章】使用aum( Automatic Undo Management) 时遇到 ORA-01555错误--- 原因和解决方式。
使用aum( Automatic Undo Management) 时遇到 ORA-01555错误--- 原因和解决方式. 參考原文: ORA-01555 Using Automatic Undo M ...
- JAVA实现RSA加密解密 非对称算法
首先RSA是一个非对称的加密算法.所以在使用该算法加密解密之前,必须先行生成密钥对.包含公钥和私钥 JDK中提供了生成密钥对的类KeyPairGenerator,实比例如以下: public stat ...
- 转 java中5种创建对象的方法
作为Java开发者,我们每天创建很多对象,但我们通常使用依赖管理系统,比如spring去创建对象.然而这里有很多创建对象的方法,我们会在这篇文章中学到. Java中有5种创建对象的方式,下面给出它们的 ...
- Android抽屉菜单DrawerLayout的实现案例
(1)项目布局文件 activity_main.xml <android.support.v4.widget.DrawerLayout xmlns:android="http://sc ...
- LeetCode 69. Sqrt(x) (平方根)
Implement int sqrt(int x). Compute and return the square root of x. x is guaranteed to be a non-nega ...
- 汉澳Sinox2014X64server高级桌面服务器版操作系统公布
汉澳Sinox2014X64server高级桌面服务器版操作系统公布 当你在现代城市夜空中看到一道闪电.屏幕中央闪过几个图形,转眼间变成美轮美奂的紫色空中天国,说明你来到了汉澳sinox2014世 ...
- hdoj-1214-圆桌会议【逆序数】
圆桌会议 Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others) Total Submissi ...