-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
20 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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以上版本。 |