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 ...
随机推荐
- ABP框架系列之十六:(Dapper-Integration-Dapper集成)
Introduction Dapper is an object-relational mapper (ORM) for .NET. Abp.Dapper package simply integra ...
- IDA显示字节机器码
默认居然不显示,有点坑. 要像CE一样显示出来,需要 菜单 Options >> General Disassembly选项卡Number of opcode bytes写上非0,写1好像 ...
- myeclipse 自动部署web项目(自动编译)
打开自动编译:project->build automatically; 注:以下两种方法适用tomcat配置在myeclipse中的情况. 1.如果在myeclipse中tomcat是以deb ...
- Makefile基础学习
Makefile基础学习 理论知识 makefile关系到了整个工程的编译规则.一个工程中的源文件不计其数,并且按类型.功能.模块分别放在若干个目录中,makefile定义了一系列的规则来指定,哪些文 ...
- Spring-Cloud之Eureka排坑之旅
1 快速demo 1.0 环境说明 Intelli IDEA+Spring Boot 1.1 新建工程chap52(通过New Project->Spring Initializer-> ...
- 背水一战 Windows 10 (63) - 控件(WebView): 基础知识, 加载 html, http, https, ms-appx-web:///, embedded resource, ms-appdata:///, ms-local-stream://
[源码下载] 背水一战 Windows 10 (63) - 控件(WebView): 基础知识, 加载 html, http, https, ms-appx-web:///, embedded res ...
- kaldi脚本注释一
utils/split_data.sh ##再$data文件夹下,创建split{num_split}文件夹,再split×里面创建所有的数字文件夹#后面基本上是把$data文件夹下的各个文件都进行s ...
- 笔记:Activity的启动过程
Activity的创建特点 作为四大组件之一的Activity,它不像普通java对像那样,可以new出来,然后去使用.而是调用 startActivity()这样的方式启动.那么Android系统是 ...
- Linux pwn入门教程(1)——栈溢出基础
作者:Tangerine@SAINTSEC 原文来自:https://bbs.ichunqiu.com/thread-42241-1-1.html 0×00 函数的进入与返回 要想理解栈溢出,首先必须 ...
- onload事件
onload事件:页面加载(文本和图片)完毕的时候, onload的作用: JS加载时和html是同步加载的,如果使用元素在定义元素之前易报错: <!DOCTYPE html> <h ...