当前位置:网站首页>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的连接客户端的版本过低。
边栏推荐
- MATLAB程序设计与应用 2.7 结构数据与单元数据
- 下午见!2022京东云数据库新品发布会
- build --repot
- MATLAB programming and application 2.7 Structural data and unit data
- 【文件IO的简单实现】
- 实至名归!九章云极DataCanvas公司荣获智能制造领域多项殊荣
- Dry goods!A highly structured and sparse linear transformation called Deformable Butterfly (DeBut)
- Depth study of 100 cases - convolution neural network (CNN) to realize the clothing image classification
- 自定义实现乘风破浪的小船
- Cookie和Session使用
猜你喜欢

Spinner文字显示不全解决办法

MySQL数据库实战(1)

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

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

synchronized

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

卷起来!阿里高工携18位高级架构师耗时57天整合的1658页面试总结

"Global Digital Economy Conference" landed in N World, Rongyun provides communication cloud service support

for in 和 for of的区别

Matplotlib
随机推荐
Activiti产生的背景和作用
for in 和 for of的区别
鸿蒙第四次
如何检索IDC研究报告?
多态详细讲解(简单实现买票系统模拟,覆盖/重定义,多态原理,虚表)
LyScript 实现对内存堆栈扫描
Advanced use of MySQL database
【TypeScript】为什么要选择 TypeScript?
从餐桌到太空,孙宇晨的“星辰大海”
二叉搜索树(搜索二叉树)模拟实现(有递归版本)
[Explanation of JDBC and inner classes]
优炫数据库在linux平台下服务启动失败的原因
3D激光SLAM:LeGO-LOAM---两步优化的帧间里程计及代码分析
"Global Digital Economy Conference" landed in N World, Rongyun provides communication cloud service support
科普大佬说 | 黑客帝国与6G有什么关系?
微信多开批处理(自动获取安装路径)
QT with OpenGL(Shadow Mapping)(面光源篇)
type="module" you know, but type="importmap" you know
redis基础知识总结——数据类型(字符串,列表,集合,哈希,集合)
How to use outside the PHP command in the container