当前位置:网站首页>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的连接客户端的版本过低。
边栏推荐
猜你喜欢
随机推荐
图新地球为什么很模糊,白球、看图、下载问题深度剖析
DOM对象能干什么?
ScrollView嵌套RecyclerView滚动冲突
深度学习经典网络 -- Inception系列(稀疏结构)
ERC20通证标准是什么?
LeetCode第三题(Longest Substring Without Repeating Characters)三部曲之二
This article takes you to understand the principle of CDN technology
通过GBase 8c Platform安装数据库集群时报错
深入解析分布式文件系统的一致性的实现
苏州大学:从PostgreSQL到TDengine
Analysis of the idea of the complete knapsack problem
混合型界面:对话式UI的未来
What is the relationship between The Matrix and 6G?
【输出一个整数的的每一位,由高到低输出。使用递归和不使用递归】
[Explanation of JDBC and inner classes]
试题G:单词分析 ← 第十一届蓝桥杯大赛第二场省赛赛题
在 Chrome 开发者工具里通过 network 选项模拟网站的离线访问模式
巴比特 | 元宇宙每日必读:玩家离场,平台关停,数字藏品市场正逐渐降温,行业的未来究竟在哪里?...
记某社区问答
What is the ERC20 token standard?









