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 ...
随机推荐
- GUI学习之二十七——布局管理学习总结
今天讲一个大的内容——布局管理. 一.布局管理的诞生背景 在前面所讲的所有案例中,我们都是用采用手动布局的方式来布局的.结合个案例来说明一下:在一个界面上放三个label,三个label纵向排列 fr ...
- u-boot-2019.07 移植步骤
doc/README.kconfig Tips to add/remove boards------------------------- When adding a new board, the f ...
- css使既有浮动又有左右margin的多个元素两端对其
两端对齐效果 如上图中红色的9个div它们中间有间距,而最左边和最右边是没有间距的,这种布局如果使用css3的flex来实现是非常简单的,而如果要使用float布局就需要一些特殊的技巧了. 实现原理 ...
- iOS - 图片的显示模式
- mybatis学习$与#号取值区别
1,多个参数传递用map或实体封装后再传给myBatis, mybatis学习$与#号取值区别 #{} 1.加了单引号, 2.#号写是可以防止sql注入,比较安全 select * from use ...
- 题解 P2674 【《瞿葩的数字游戏》T2-多边形数】
题目说了很清楚,此题找规律,那么就找规律. 我们观察数列. 令k表示数列的第k个数. 三角形数:1 3 6 10 15 两项相减:1 2 3 4 5 再次相减:1 1 1 1 1 四边形数:1 4 9 ...
- PHPExcel组件编程spl_autoload_register
E:\html\tproject\framework\modules\common\vendor\PHPExcel\Classes\PHPExcel.php <?php /** PHPExcel ...
- Hello Kotlin! Kotlin学习资料
今天谷歌搞了条大新闻.宣布Kotlin成为android开发的一级(One Class)语言,这说明谷歌是被甲骨文恶心坏了,打算一步步脱离掉java或者说是甲骨文公司的束缚了.原先网上大家还琢磨着会不 ...
- Longest Subarray(HDU6602+线段树)
题意 要你找一个最长的区间使得区间内每一个数出现次数都大于等于K. 题解->https://blog.csdn.net/Ratina/article/details/97503663 #incl ...
- php 判断访问是否是手机或者pc
php代码 function isMobile() { $user_agent = $_SERVER['HTTP_USER_AGENT']; $mobile_agents = Array(" ...