当前位置:网站首页>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的连接客户端的版本过低。
边栏推荐
- Dva.js 新手入门指南
- 混动产品谁更吃香,看技术还是看市场?
- 机器学习概述
- Dry goods!A highly structured and sparse linear transformation called Deformable Butterfly (DeBut)
- 成为优秀架构师必备技能:怎样才能画出让所有人赞不绝口的系统架构图?秘诀是什么?快来打开这篇文章看看吧!...
- for in 和 for of的区别
- How to retrieve IDC research reports?
- mysql数据库定时备份占用大量线程,导致全局锁表,有啥好的解决方法么
- MySQL数据库基本使用
- 「全球数字经济大会」登陆 N 世界,融云提供通信云服务支持
猜你喜欢
苏州大学:从PostgreSQL到TDengine
机器学习概述
成为优秀架构师必备技能:怎样才能画出让所有人赞不绝口的系统架构图?秘诀是什么?快来打开这篇文章看看吧!...
全新的Uber App设计
Simple implementation of a high-performance clone of Redis using .NET (1)
CADEditorX ActiveX 14.1.X
MySQL数据库高级使用
实至名归!九章云极DataCanvas公司荣获智能制造领域多项殊荣
成为优秀架构师必备技能:怎样才能画出让所有人赞不绝口的系统架构图?秘诀是什么?快来打开这篇文章看看吧!...
深度学习100例——卷积神经网络(CNN)实现服装图像分类
随机推荐
面试一面
[Output each bit of an integer, from high to low.With and without recursion]
[华为云在线课程][SQL语法入门][学习笔记]
深度学习经典网络 -- Inception系列(稀疏结构)
Skills required to be a good architect: How to draw a system architecture that everyone will love?What's the secret?Come and open this article to see it!...
使用.NET简单实现一个Redis的高性能克隆版(一)
【JDBC以及内部类的讲解】
Advanced use of MySQL database
QT with OpenGL(Shadow Mapping)(面光源篇)
成为优秀架构师必备技能:怎样才能画出让所有人赞不绝口的系统架构图?秘诀是什么?快来打开这篇文章看看吧!...
Web Server 设置缓存响应字段的一些推荐方案
MATLAB programming and application 2.7 Structural data and unit data
Analysis of the idea of the complete knapsack problem
RecyclerView的item高度自适应
[Star Project] Little Hat Plane Battle (9)
Cross-chain bridge protocol Nomad suffers hacker attack, losing more than $150 million
oracle计算同、环比
从餐桌到太空,孙宇晨的“星辰大海”
What is the relationship between The Matrix and 6G?
Simple implementation of a high-performance clone of Redis using .NET (1)