前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >Client does not support authentication protocol requested by server

Client does not support authentication protocol requested by server

作者头像
用户2146693
发布2020-05-06 19:20:21
6340
发布2020-05-06 19:20:21
举报
文章被收录于专栏:架构师进阶架构师进阶

背景

环境:MAC Docker, Windows10 Docker

Mysql版本:8.0.19

启动命令:docker run -p 3307:3306 --name 8mysql -e MYSQL_ROOT_PASSWORD=123456 mysql:latest

Navicat:11.0.19

现象:

代码语言:javascript
复制
Client does not support authentication protocol requested by server; consider upgrading MySQL client

解决方案

ALTER USER 'root'@'%' IDENTIFIED WITH mysql_native_password BY '123456';

ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY '123456';

flush privileges;

原因

In MySQL 8.0, caching_sha2_password is the default authentication plugin rather than mysql_native_password.

mysql8.0以后, 默认加密plugin,是caching_sha2_password

需要改为Navi cat支持的mysql_native_password

mysql -u root -p

use mysql;

select host,user,plugin from user;

代码语言:javascript
复制
+-----------+------------------+-----------------------+
| host      | user             | plugin                |
+-----------+------------------+-----------------------+
| %         | root             | caching_sha2_password |
| localhost | mysql.infoschema | caching_sha2_password |
| localhost | mysql.session    | caching_sha2_password |
| localhost | mysql.sys        | caching_sha2_password |
| localhost | root             | caching_sha2_password |
+-----------+------------------+-----------------------+

执行完后:

代码语言:javascript
复制
+-----------+------------------+-----------------------+
| host      | user             | plugin                |
+-----------+------------------+-----------------------+
| %         | root             | mysql_native_password |
| localhost | mysql.infoschema | caching_sha2_password |
| localhost | mysql.session    | caching_sha2_password |
| localhost | mysql.sys        | caching_sha2_password |
| localhost | root             | mysql_native_password |
+-----------+------------------+-----------------------+

参考

6.4.1.2 Caching SHA-2 Pluggable Authentication

caching_sha2_password as the Preferred Authentication Plugin

docker安装mysql容器后,是用navicat连接报client does not support authentication protocol requested by server consider upgrading mysql client

本文参与 腾讯云自媒体分享计划,分享自作者个人站点/博客。
如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体分享计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
目录
  • 背景
  • 解决方案
  • 原因
  • 参考
相关产品与服务
云数据库 SQL Server
腾讯云数据库 SQL Server (TencentDB for SQL Server)是业界最常用的商用数据库之一,对基于 Windows 架构的应用程序具有完美的支持。TencentDB for SQL Server 拥有微软正版授权,可持续为用户提供最新的功能,避免未授权使用软件的风险。具有即开即用、稳定可靠、安全运行、弹性扩缩等特点。
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档