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 ...
随机推荐
- 友盟 个推 微信sdk spring boot
友盟 个推 微信sdk spring boot ngix mongodb memory cache
- 使用DBMS_REDEFINITION在线切换普通表到分区表
随着数据库数据量的不断增长,有些表须要由普通的堆表转换为分区表的模式.有几种不同的方法来对此进行操作.诸如导出表数据,然后创建分区表再导入数据到分区表.使用EXCHANGE PARTITION方式来转 ...
- 利用scons构建project
scons有非常多相对于make构建系统的优秀特性,可是因为发展时间比較短如今的应用范围还是不太多,可以找到的资料也不是非常多. scons如今一大问题就是初始上手还是有点难度的,对于有python的 ...
- Android Message和obtainMessage的差别
前几天须要实现一个以太网功能就看了以太网的源代码部分,看见了源代码部分在消息处理时,发现有一些不同的地方: 平时我在处理消息时: 1.首先创建Handler对象: private Hand ...
- CloudEngine 6800基础配置-01_常见密码操作
由于工作原因,现在从事公有云. 这简直就是个笑话,12年后又回来学网络知识. # 设置系统的日期.时间和时区 <HUAWEI> clock timezone BJ add 08:00: ...
- oc const 关键字 对指针的理解
/* int const *p; *p是常量, p是变量 const int *p; *p是常量, p是变量 int * const p; *p是变量, p是常量 const int * const ...
- 让ListView回来原来的位置
让ListView回到原来的位置 当从ListView中的某一个Item跳转到其他的Activity,进行操作之后,ListView可能需要刷新(重新加载数据源),这个时候ListView就会回到原始 ...
- 第一章、Tiny4412 U-BOOT移植一 说明【转】
本文转载自:http://blog.csdn.net/eshing/article/details/37520291 一.移植前说明: 1. 特别声明:此文档是我的学习文档,里面肯定有错误地方,仅供 ...
- new (C# Reference)
https://msdn.microsoft.com/en-us/library/51y09td4.aspx In C#, the new keyword can be used as an oper ...
- java事件处理机制(自定义事件)
java中的事件机制的参与者有3种角色: 1.event object:事件状态对象,用于listener的相应的方法之中,作为参数,一般存在与listerner的方法之中 2.event sourc ...