今天安装安装一个叫得推校园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…的更多相关文章

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

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

  2. 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 ...

  3. 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 ...

  4. 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 ...

  5. Laravel - 解决连接MySQL时报"The server requested authentication method unknown to the client”错误

    2019-04-12发布:hangge阅读:934   1,问题描述 最近建了个 Laravel 项目,当配置好 MySQL 数据库进行请求时,页面报如下错误:   SQLSTATE[HY000] [ ...

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

    mysql 安装了最新版本8.0.11后创建用户并授权后,授权的用户连接数据库提示 The server requested authentication method unknown to the ...

  7. Navicat连接mysql8.0.1版本出现1251--Client does not support authentication protocol requested by server的解决

    转载自:https://blog.csdn.net/XDMFC/article/details/80263215 好不容易安装好mysql,但又出现了mysql客户端版本太低的问题.根据参考的这篇博客 ...

  8. Docker mysql 连接 “The server requested authentication method unknown to the clien”错误

    查了下,出现这个错误的原因是从mysql 5.6开始,mysql密码加密算法更改了. 我装的mysql 8.* ,那么有两种解决方法: mysql 版本选择 <= 5.6 修改密码 docker ...

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

    title: 远程连接MYSQL8.0服务器问题 date: 2018-07-07 11:02:26 updated: tags: [MYSQL,坑] description: keywords: c ...

随机推荐

  1. doT js模板入门 3

    for 循环前推断循环的list是否为空 <script id="invoiceListDot" type="text/x-dot-template"&g ...

  2. 2014年辛星starphp第一节设置入口文件以及App类

    *********************本节目标**************** 1.首先是我们的框架大致布局,我们即将写成的这个框架.它的入口文件统一为star.php.它须要做的一些事,比方载入 ...

  3. struts2国际化---配置国际化全局资源文件并输出国际化资源信息

    我们首先学习怎么配置国际化全局资源文件.并输出资源文件信息 1.首先struts2项目搭建完毕后,我们在src文件夹下.即struts2.xml同级文件夹下创建资源文件.资源文件的名称格式为: XXX ...

  4. addSubview和insertSubview 区别

     子视图是以栈的方式存放的. 每次addsubview时都是在最后面添加. 每次在addsubview前和addsubview后可以看看[self.view.subViews count]: 你看看你 ...

  5. LeetCode 551. Student Attendance Record I (学生出勤纪录 I)

    You are given a string representing an attendance record for a student. The record only contains the ...

  6. HDU - 3631 Shortest Path(Floyd最短路)

    Shortest Path Time Limit: 1000MS Memory Limit: 32768KB 64bit IO Format: %I64d & %I64u SubmitStat ...

  7. Ubuntu环境下安装nodejs和npm

    1.安装python-software-properties sudo apt-get install python-software-properties 2.添加ppa curl -sL http ...

  8. ubuntu查看'任务管理器'

    ubuntu下的任务管理器打开方式:命令行输入'gnome-system-monitor'即可,展示如下:

  9. mybatis传参问题总结

    一. 传入单个参数 当传入的是单个参数时,方法中的参数名和sql语句中参数名一致即可 List<User> getUser(int id); <select id="get ...

  10. Akka源码分析-Router

    akak中还有一个比较重要的概念,那就是Router(路由).路由的概念,相信大家都不陌生,在akka中,它就是其他actors的一个代理,会把消息按照路由规则,分发给指定的actor.我一般喜欢把R ...