authentication plugin caching_sha2_password cannot be loaded
最近下载新的MySQL8.0 来使用的时候, 通过sqlyog、或者程序中连接数据库时,提示:Authentication plugin 'caching_sha2_password' cannot be loaded 的错误,经查看发现,8.0改变了 身份验证插件 , 打开 my.ini (或者my.cofg) 可以看到变更了 5.7及其以前的方式: mysql_native_password
解决
Authentication plugin ‘caching_sha2_password’ cannot be loaded 的方法,可以往你的连接工具、或者程序应用显示指定身份验证方式,或者直接改为以前的版本方式:
你可以使用如下方式:
这里root的密码改为hovertree,使用老版本的身份验证插件方式:
ALTER USER root@localhost IDENTIFIED WITH mysql_native_password BY ‘hovertree’;
先来解释一下为什么会报这个错,在mysql8之前的版本使用的密码加密规则是mysql_native_password,但是在mysql8则是caching_sha2_password。
解决方案有很多,我是创建了一个新用户,并指定加密规则为:mysql_native_password,这样的话,仅需要执行以下语句即可:
create user 'your username'@'%' identified with mysql_native_password by 'your password'
也可以直接修改my配置文件,将默认密码规则设置为mysql_native_password,刷新权限并重置root密码即可。
default_authentication_plugin=mysql_native_password
如果想用新的caching_sha2_password也是可以的,java的话mysql已经推出了新的mysql-connector-java包,引入后,驱动使用com.mysql.cj.jdbc.driver即可,这个方案本地试了。没有问题。
在安装mysql8的时候如果选择了密码加密,之后用客户端连接比如navicate,会提示客户端连接caching-sha2-password,是由于客户端不支持这种插件,可以通过如下方式进行修改:
#修改加密规则
ALTER USER 'root'@'localhost' IDENTIFIED BY 'password' PASSWORD EXPIRE NEVER;
#更新密码(mysql_native_password模式)
ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY 'Hovertree';
其中 Hovertree 为新密码
authentication plugin caching_sha2_password cannot be loaded的更多相关文章
- 2059 - Authentication plugin 'caching_sha2_password' cannot be loaded: dlopen(../Frameworks/caching_sha2_password.so, 2): image not found
mac本地安装mysql后,navicat连接报错: - Authentication plugin ): image not found 解决方法 在控制台登陆后重新改下密码即可 ALTER USE ...
- 解决mysql for docker容器报错:Authentication plugin 'caching_sha2_password' cannot be loaded
为图方便,懒得在mac上安装mysql了,一个是管理不方便,第二个是为了方便多机器同步开发环境.就使用docker安装了. 拉取mysql镜像 docker pull mysql 运行mysql实例 ...
- ERROR 2059 (HY000): Authentication plugin 'caching_sha2_password' cannot be loaded
问题: 连接Docker启动的mysql出现:ERROR 2059 (HY000): Authentication plugin 'caching_sha2_password' cannot be l ...
- ERROR 2059 (HY000): Authentication plugin 'caching_sha2_password' cannot be loaded: /usr/lib64/mysql/plugin/caching_sha2_password.so: cannot open shared object file: No such file or directory
部署docker下的mysql时出现以下报错 [root@docker ~]# mysql -h192.168.30.22 -uroot -p Enter password: 出现报错: ERROR ...
- mysql 无法连接提示 Authentication plugin 'caching_sha2_password' cannot be loaded
mysql 无法连接提示 Authentication plugin 'caching_sha2_password' cannot be loaded 可能是密码没有设置或者,密码设置类型不符,可参考 ...
- MySql 8.0.11 客户端连接失败:2059 - Authentication plugin 'caching_sha2_password' cannot be loaded: ....
近期,换了新笔记本,重新安装了MySql数据库和客户端工具Navicat Premium 12.我是从官网上下载的MySql数据库,版本为8.0.11,链接:https://dev.mysql.com ...
- Mac_Navicat Premium连接MySQL错误2059 - Authentication plugin 'caching_sha2_password' cannot be loaded: dlopen(../Frameworks/caching_sha2_password.so, 2): image not found
mac下MySql启动连接报错:Authentication plugin ‘caching_sha2_password’ cannot be loaded: dlopen(/usr/local/my ...
- MySQL Authentication plugin 'caching_sha2_password' cannot be loaded
很多用户在使用Navicat Premium 12连接MySQL数据库时会出现Authentication plugin 'caching_sha2_password' cannot be loade ...
- mysql8.0 Authentication plugin 'caching_sha2_password' cannot be loaded
安装mysql8.0后使用navicat创建连接, 然后报如题所示警告.可参考如下解决方案: https://stackoverflow.com/questions/49194719/authenti ...
随机推荐
- Win7 64位使用IDA Pro 6.8调试64位exe程序
有点小坑,记录备忘. 首先搞个IDA Pro6.8,写本文时能找到的最高版本,试了下果然比6.6强大许多,其实6.6也没怎么用过...... 32位版本有个Local Win32 debugger,但 ...
- 通过MFC设计一个简单的计价程序
1.实验目的 掌握使用MFC应用程序向导创建应用程序的方法. 掌握新建对话框资源的方法. 掌握生成对话框的方法. 2.实验内容 用应用程序创建一个默认的对话框应用程序,在对话框中能进入下一个对话框,在 ...
- 2-postman批量执行接口
1.postman环境设置与使用 1)点击设置,添加按钮 2)填写环境名称,参数 3)切换环境 4)使用环境变量,使用格式为:{{变量名}} 2.postman批量执行接口 1)选择要执行的文件夹,点 ...
- Vuejs——(13)组件——杂项
版权声明:出处http://blog.csdn.net/qq20004604 目录(?)[+] 本篇资料来于官方文档: http://cn.vuejs.org/guide/components ...
- webapi 自定义缓存实现
定义一个Filter public class MyOutputCacheAttribute : ActionFilterAttribute { MemoryCacheDefault _cache = ...
- .NET Core微服务之路:利用DotNetty实现一个简单的通信过程
上一篇我们已经全面的介绍过<基于gRPC服务发现与服务治理的方案>,我们先复习一下RPC的调用过程(笔者会在这一节的几篇文章中反复的强调这个过程调用方案),看下图
- C# 交集、差集、并集、去重
Intersect 交集,Except 差集,Union 并集 , , , , }; , , , , , }; var jiaoJi = oldArray.Intersect(newArray).To ...
- 项目Alpha冲刺(团队1/10)
项目Alpha冲刺(团队1/10) 团队名称: 云打印 作业要求: 项目Alpha冲刺(团队) 作业目标: 完成项目Alpha版本 团队队员 队员学号 队员姓名 个人博客地址 备注 221600412 ...
- The MAC is invalid
在使用laravel框架进行网站开发时,我们会使用laravel的Crypt类对用户的密码进行加密来达到信息加密的目的,Crypt类会对数据加密时会依赖APP_KEY,所以当更换了APP_KEY时,再 ...
- Javascript百学不厌 - this
最近看了一本书,让自己的野路子走走正规路线 方法调用模式: 方法:当一个函数被保存为对象的一个属性时,我们称它为一个方法. var obj = { fun1: function() {this} // ...