Skip to content

Commit

Permalink
update mysql8 authentication
Browse files Browse the repository at this point in the history
  • Loading branch information
lcp0578 committed Sep 8, 2018
1 parent 4341c4d commit a155350
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 1 deletion.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,7 @@
- [DROP INDEX](src/MySQL/DROP_INDEX.md)
- [Atlas](src/MySQL/Atlas.md) Atlas (MySQL proxy) 使用
- [MySQL 8 windows install](src/MySQL/mysql8_windows_install.md) MySQL8在windows下的安装
- [MySQL8 authentication plugin](src/MySQL/mysql8_authentication_plugin.md)MySQL8密码验证插件更换后,问题解决办法
4. [composer](src/composer/README.md "composer")
- [composer basic](src/composer/basic.md) composer基础使用
- [composer config](src/composer/config.md) composer配置相关
Expand Down
3 changes: 2 additions & 1 deletion src/MySQL/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,5 @@
- [windows mysql](windows_mysql.md) windows下安装mysql
- [DROP INDEX](DROP_INDEX.md)
- [Atlas](Atlas.md) Atlas (MySQL proxy) 使用
- [MySQL 8 windows install](mysql8_windows_install.md) MySQL8在windows下的安装
- [MySQL 8 windows install](mysql8_windows_install.md) MySQL8在windows下的安装
- [MySQL8 authentication plugin](mysql8_authentication_plugin.md)MySQL8密码验证插件更换后,问题解决办法
17 changes: 17 additions & 0 deletions src/MySQL/mysql8_authentication_plugin.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
## MySQL8 authentication plugin
- MySQL default authentication-plugin
- MySQL8之前版本,采用:mysql_native_password
- MySQL8 采用:caching_sha2_password
- MySQL客户端提示连接失败解决办法
- 修改默认配置

default-authentication-plugin=mysql_native_password
- 重新设置root密码

use mysql;
ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'new password';
FLUSH PRIVILEGES;
- PHP报错:SQLSTATE[HY000] [2054] The server requested authentication method unknown to the client
- 错误原因:由于MySQL 8默认使用了新的密码验证插件:caching_sha2_password,而之前的PHP版本中所带的mysqlnd无法支持这种验证。
- 升级PHP,查看phpinfo的mysqlnd的Loaded plugins部分,是否包含caching_sha2_password
- 目前开始支持的版本:PHP 7.1.20以上版本和PHP 7.2.8以上版本。

0 comments on commit a155350

Please sign in to comment.