Docker mysql 连接 “The server requested authentication method unknown to the clien”错误
查了下,出现这个错误的原因是从mysql 5.6开始,mysql密码加密算法更改了。
我装的mysql 8.* ,那么有两种解决方法:
- mysql 版本选择 <= 5.6
- 修改密码
docker-comopse exec mysql bash
mysql -uroot -psecret
alter user `db_user`@'%' identified with mysql_native_password by 'db_password';
flush privilefes;解决。
2018-12-5 update:
PS:Laravel中的.env设置的是:DB_CONNECTION=mysql
DB_HOST=mysql
DB_PORT=
DB_DATABASE=db_name
DB_USERNAME=db_user
DB_PASSWORD=db_pwdDB_HOST 是docker 中mysql container 名字。
DB_PORT 是mysql container 内部端口
Docker mysql 连接 “The server requested authentication method unknown to the clien”错误的更多相关文章
- 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 ...
- 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 ...
- 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 ...
- 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 ...
- Warning: mysqli_connect(): The server requested authentication method unknown to the client [caching_sha2_password]报错解决方法
错误: 解决方法:
- PHP Warning: mysqli_connect(): The server requested authentication method unknown to the client [caching_sha2_password] in /usr/local/php/CreateDB.php on line 5
原因:php还不支持mysql8.0最新的密码加密方式 ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY ' ...
- 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,但是客户端暂时不支持这个插件导致的. 解决方法一 ...
随机推荐
- STL源码剖析(仿函数/bind2nd)
仿函数(functors)其实就是重载了operator()的对象. 下面简单先看看它的一个例子: #include <iostream> using namespace std; tem ...
- c++继承总结
继承 1)继承是面向对象程序设计实现软件重用的重要方法.程序猿能够在已有基类的基础上定义新的派生类. 2) 单继承的派生类仅仅有一个基类.多继承的派生类有多个基类. 3) 派生类对基类成员的訪问由继承 ...
- Android 4.4KitKat AudioTrack 流程分析
Android Audio 系统的主要内容: AudioManager:这个主要是用来管理Audio系统的,需要考虑整个系统上声音的策略问题,例如来电话铃声,短信铃声等,主要是策略上的问题. Audi ...
- 零样本学习 - (Zero shot learning,ZSL)
https://zhuanlan.zhihu.com/p/41846072 https://zhuanlan.zhihu.com/p/38418698 https://zhuanlan.zhihu.c ...
- Exif.js获取图片的详细信息(苹果手机移动端上传图片旋转90度)
Exif.js插件介绍 http://code.ciaoca.com/javascript/exif-js/ iOS手机竖着拍的照片经过前端处理之后被旋转了90°的原因以及解决方案 https://w ...
- Wpf 自定义控件(1)
1. 新建一个wpf工程,在工程下面新建 一个文件夹themes,在themes下新建两个资源字典文件generic.xaml和PrettySeekBar.xaml generic.xaml ...
- MONGODB Date 处理方法
mongodb 日期处理:1,用new Date()存入数据库,要转一下.2,输出的显示的时候,要把data 后的Z 去啦.3, 查询时数据时不用处理.
- 李洪强iOS开发OC[001]-NSLog函数的使用方法
- 老司机的应用级监控——spring?actuator
http://mt.sohu.com/20160824/n465783118.shtml ************************************************ 1什么是sp ...
- CCNA2.0笔记_IP连接排错
IPv4 路由排错 ping tracert traceroute telnet show mac address-table show interfaces fastEthernet 0/1 sho ...