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,但是客户端暂时不支持这个插件导致的. 解决方法一 ...
随机推荐
- 如何设置outlook实现自动秘密抄送邮件的功能?
很多朋友会发现虽然在家里同步了公司的邮箱可以正常收发邮件,可是每当使用家里的outlook发送相关邮件的时候,在公司的邮箱里找不到相关的发件记录,只能同步收件箱,而不能同步发件箱应该是比较让人困扰的问 ...
- android:imeOptions属性
imeOptions软键盘setOnEditorActionListener 默认情况下软键盘右下角的按钮为“下一个”,点击会到下一个输入框,保持软键盘 设置 android:imeOptions= ...
- sklearn中xgboost模块中plot_importance函数(特征重要性)
# -*- coding: utf-8 -*- """ ######################################################### ...
- Python处理验证码第一篇(pytesser初探及报错处理)
(原文链接:http://blog.csdn.net/Bone_ACE/article/details/50436587) 前言: 春节期间,无法全身心投入地去写爬虫,那就玩玩验证码吧,应该比较有趣! ...
- html5_storage存取实例
<script src="jquery-1.8.3.js"></script><script>function set(){ var tt ...
- js 时间对比
https://www.cnblogs.com/xiangsj/p/7977325.html http://www.jb51.net/article/45560.htm isOverdue (time ...
- django源码分析---- Model类型&Field类型
djiango在数据库这方式自己实现了orm(object relationship mapping 对象关系模型映射).这个主要是用到python 元类这一 项python中的高级技术来实现的. c ...
- 为centos桌面增加在右键中打开终端
万万没有想到这只是安装一个程序的总是,而不是配置的问题.注意要用root身份才能安装软件 1. yum -y install nautilus-open-terminal 2. reboot
- c++ abs与fabs
在stdlib.h中定义的abs只针对整数取决对值,如果要对浮点数取绝对值,应该用fabs(或fabsf). 而math.h中定义的abs是可以对浮点数取绝对值的. 所以如果包含了stdlib.h和m ...
- PHP 时间与日期
PHP提供了大量的内置函数,使开发者在时间的处理上游刃有余,大大提高了工作效率. 介绍一些常见的PHP日期和时间函数以及日期和时间的处理. 经常使用的日期和时间处理函数 函 数 说 明 checkd ...