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 to the client (SQL: select * from information_schema.tables where table_schema = move and table_name = migrations and table_type = 'BASE TABLE') In PDOConnection.php line : SQLSTATE[HY000] [] The server requested authentication method unknown to the client In PDOConnection.php line : SQLSTATE[HY000] [] The server requested authentication method unknown to the client In PDOConnection.php line : PDO::__construct(): The server requested authentication method unknown to the client [caching_sha2_password]
原因:
mysql8默认的使用密码认证方式不一样,mysql8.0默认使用caching_sha2_password,但是之前版本都是使用mysql_native_password
解决方案
修改caching_sha2_password为mysql_native_password
select user,host,plugin from mysql.user;

我这里执行了两句修改,修改root身份的“localhost”和“%”,代码如下:
ALTER USER 'root'@'%' IDENTIFIED WITH mysql_native_password BY 'root';
ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'root';

执行成功:

php7.3连接MySQL8.0报错 PDO::__construct(): The server requested authentication method unknown to the client [caching_sha2_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连接mysql8.0出错“SQLSTATE[HY000] [2054] The server requested authentication method unkno…
今天安装安装一个叫得推校园O2O系统的使劲都说连接不上服务器. 下面是安装说明,我直接进行3步骤,导入数据库配置文件,结果就显示题目报错的内容 安装说明: 直接输入程序目录即可 http://loca ...
- PHP连接mysql8.0出错“SQLSTATE[HY000] [2054] The server requested authentication method unknow.....
这个错可能是mysql默认使用 caching_sha2_password作为默认的身份验证插件,而不再是 mysql_native_password,但是客户端暂时不支持这个插件导致的. 解决方法一 ...
- Warning: mysqli_connect(): The server requested authentication method unknown to the client [caching_sha2_password]报错解决方法
错误: 解决方法:
- 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 ...
- android studio连接MYSQL8.0报错:java.long.unsupportedOperation处理方案
纠结了我大概一个星期了! 下载的别人的demo测试,因为还没学线程连接网络啥的 对方使用的版本是MYSQL5.1.14,我使用的8.0.18,同样都是阿里云服务器自建数据库. 由于是版本8.0,所以在 ...
- kettle 连接 mysql8.0 报错的解决办法 org.pentaho.di.core.exception.KettleDatabaseException: Error occurred while trying to connect to the database Error connecting to database: (using class org.gjt.mm.mysql.
1.下载 mysql8.0 驱动放到 如下目录中 mysql8.0以上的驱动下载链接:mysql-connet-8.0.13 2.配置你连接的数据库 找到如下文件打开编辑 连接信息:下面是我本地的配置 ...
- IntelliJ IDEA集成工具Database连接MySQL8.0报错的解决方法
直接用默认配置连接的话,会报以下错误: Connection to MySQL - @localhost failed. [08001] Could not create connection to ...
随机推荐
- python面向对象--类的装饰器
# def deco(obj): # print("=====",obj) # obj.x=1 # return obj # @deco#===> test = deco(t ...
- Springboot配置文件占位符
一.配置文件占位符 1.application.properties server.port=8088 debug=false product.id=ID:${random.uuid} product ...
- Vscode中解决Html文件中不能打断点问题
Vscode中解决Html文件中不能打断点问题: 默认情况下,VSCode是不能在Html文件里打断点的,但是可以修改设置,依次打开:文件->首选项->设置,然后功能->调试-> ...
- 转 Java中final、finally、finalize的区别与用法
Java中final.finally.finalize的区别与用法 1.简单区别:final用于声明属性,方法和类,分别表示属性不可交变,方法不可覆盖,类不可继承.finally是异常处理语句结构 ...
- LTE系统时延及降低空口时延的4种方案
转载:https://rf.eefocus.com/article/id-LTE%20delay 对于移动通信业务而言,最重要的时延是端到端时延, 即对于已经建立连接的收发两端,数据包从发送端产生,到 ...
- metaclass简单使用
metaclass : 元类, 就是创建python类对象的类 # 便用type动态创建类 # 1. 使用type创建一个User类对象 无基类,无属性 . () : 表示基类, {}:属性 User ...
- Mysql数据库常见试题
引用自http://blog.csdn.net/laoniyouxi123/article/details/51161157 sql语句应该考虑哪些安全性? 答: (1)防止sql注入,对特殊字符进行 ...
- BZOJ 2427: [HAOI2010]软件安装 tarjan + 树形背包
Description 现在我们的手头有N个软件,对于一个软件i,它要占用Wi的磁盘空间,它的价值为Vi.我们希望从中选择一些软件安装到一台磁盘容量为M计算机上,使得这些软件的价值尽可能大(即Vi的和 ...
- 【bzoj1096】[ZJOI2007]仓库建设
*题目描述: L公司有N个工厂,由高到底分布在一座山上.如图所示,工厂1在山顶,工厂N在山脚.由于这座山处于高原内陆地区(干燥少雨),L公司一般把产品直接堆放在露天,以节省费用.突然有一天,L公司的总 ...
- 170815-关于Session知识点
Cookie:实际上就是一个头. 服务器会创建Cookie,并且将Cookie以一个响应头的形式发送给浏览器 浏览器收到Cookie以后,会保存 ...