当前位置:网站首页>MySQL - 2059 - Authentication plugin ‘caching_sha2_password‘ cannot be loaded
MySQL - 2059 - Authentication plugin ‘caching_sha2_password‘ cannot be loaded
2022-08-03 10:57:00 【放羊的牧码】
问题报错
2059 - authentication plugin 'caching_sha2_password' cannot be loaded...
分析原因
这个报错,中文意思就是:权限插件 caching_sha2_password 不能被加载
通过查阅 MySQL 的官方参考文档,我们看到这样的一段描述
- In MySQL 5.7, libmysqlclient uses as its default choice either mysql_native_password or the plugin specified through the MYSQL_DEFAULT_AUTH option for mysql_options().
- When a 5.7 client tries to connect to an 8.0 server, the server specifies caching_sha2_password as its default authentication plugin, but the client still sends credential details per either mysql_native_password or whatever is specified through MYSQL_DEFAULT_AUTH.
从这里,我们就明白了
- 8.0 以前的默认身份验证插件是 mysql_native_password
- 8.0 以后的默认身份验证插件是 caching_sha2_password
这里会报错的原因在上面也提到了:5.7 的客户端去连接 8.0 的服务端,因为默认的身份验证插件不同,故会造成插件不能加载的错误
说明一下:目前大多数的 MySQL 客户端都还没有升级为 8.0 的认证方式,故像 Navicat、Sequel Pro、SQLyog 等这些常用的连接工具,都有可能出现这个问题
解决方案
将 MySQL 8.0 的身份认证插件改回为 mysql_native_password
修改 身份认证插件为 mysql_native_password
#登录
mysql -uroot -ppassword
#选择数据库
use mysql;
# 注意:如果是远程连接,请将'localhost'换成'%'
ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY '你的数据库密码';
#刷新权限
FLUSH PRIVILEGES; OK,现在再用 Navicat 去连接 MySQL 便可以成功了!
最后说明其实就是你的Navicat的版本过低(如果你使用Navicat的话),就是你是用的mysql的连接客户端的版本过低。
边栏推荐
- 【二分查找详解外加递归写法】附有全部代码
- build --repot
- SAP 电商云 Spartacus UI 的 External Routes 设计明细
- Babbitt | Metaverse daily must-read: Players leave, platforms are shut down, and the digital collection market is gradually cooling down. Where is the future of the industry?...
- type="module" you know, but type="importmap" you know
- 优炫数据库在linux平台下服务启动失败的原因
- Machines need tokens more than people
- 【网络原理的概念】
- Cross-chain bridge protocol Nomad suffers hacker attack, losing more than $150 million
- 训练双塔检索模型,可以不用query-doc样本了?明星机构联合发文
猜你喜欢

The way of programmer architecture practice: how to design a sustainable evolution system architecture?

Basic using MySQL database
![[Bubble sort and odd-even sorting]](/img/89/d63afe1900a05b2a5615fcc3c09ccb.png)
[Bubble sort and odd-even sorting]
![[LeetCode—Question 2 Sum of Two Numbers Detailed Code Explanation ] The source code is attached, which can be copied directly](/img/19/a3f58d5a1150d99571205a7e2f7345.png)
[LeetCode—Question 2 Sum of Two Numbers Detailed Code Explanation ] The source code is attached, which can be copied directly

像用户体验设计师一样思考

跨链桥协议 Nomad 遭遇黑客攻击,损失超 1.5 亿美元

程序员架构修炼之道:软件架构基本概念和思维

Who is more popular for hybrid products, depending on technology or market?
![[Detailed explanation of binary search plus recursive writing method] with all the code](/img/51/c4960575a59f8ca7f161b310e47b27.png)
[Detailed explanation of binary search plus recursive writing method] with all the code

混动产品谁更吃香,看技术还是看市场?
随机推荐
DOM对象能干什么?
Analysis of the idea of the complete knapsack problem
CADEditorX ActiveX 14.1.X
苏州大学:从PostgreSQL到TDengine
type="module" you know, but type="importmap" you know
Web Server 设置缓存响应字段的一些推荐方案
MATLAB programming and application 2.7 Structural data and unit data
Pixel mobile phone system
自定义实现乘风破浪的小船
【二分查找详解外加递归写法】附有全部代码
What is the ERC20 token standard?
机器学习概述
被审稿人吐槽没有novelty!深度学习方向怎么找创新点?
Machine Learning Overview
LyScript 实现对内存堆栈扫描
CADEditorX ActiveX 14.1.X
Binary search tree (search binary tree) simulation implementation (there is a recursive version)
本周四晚19:00知识赋能第4期直播丨OpenHarmony智能家居项目之设备控制实现
【TypeScript】为什么要选择 TypeScript?
[Output each bit of an integer, from high to low.With and without recursion]