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 ...
随机推荐
- Python实例浅谈之三Python与C/C++相互调用
一.问题 Python模块和C/C++的动态库间相互调用在实际的应用中会有所涉及,在此作一总结. 二.Python调用C/C++ 1.Python调用C动态链接库 Python调用C库比较简单,不经过 ...
- java内存模型和垃圾回收(收藏)
java内存模型: https://www.cnblogs.com/handsomeye/p/5442879.html java垃圾回收 http://www.cnblogs.com/handsome ...
- ZKWeb网页框架1.8正式发布
1.8.0更新的内容有 破坏性更新 更新ZKWeb.System.Drawing到3.0.0 请修改源代码中的System.Drawing到System.DrawingCore 现在已经不再需要使用D ...
- linux 下动态链接实现原理
符号重定位 讲动态链接之前,得先说说符号重定位. c/c++ 程序的编译是以文件为单位进行的,因此每个 c/cpp 文件也叫作一个编译单元(translation unit), 源文件先是被编译成一个 ...
- Postgresql日志收集
PG安装完成后默认不会记录日志,必须修改对应的(${PGDATA}/postgresql.conf)配置才可以,这里只介绍常用的日志配置. 1.logging_collector = on/off ...
- IntelliJ Idea 授权服务器使用
JetBrains授权服务器 1 http://intellij.mandroid.cn/ 支持的版本 IntelliJ IDEA 7.0 或更高ReSharper 3.1 或更高ReSharper ...
- Swift 里 Dictionary
Dictionary uses two storage schemes: native storage and Cocoa storage. 只看 native storage 的,也就是和 OC 无 ...
- 双系统Ubuntu无法访问Win10磁盘分区解决方法
今天在linux下打开win的NTFS硬盘总是提示出错了,而且是全部的NTFS盘都出错,其中sda3错误显示如下: Error mounting /dev/sda3 at /media/struggl ...
- C语言中全局结构体指针隐含的错误
前天在嵌入式系统上,调试一个数组的全局变量时,发现该变量一直会动态变化.深入分析, 才发现该全局结构体没有申请内存,而是用了一个指针.这种情况编译器是检查不出来的,在linux 上运行会挂掉,但是在裸 ...
- PyTorch(二)Intermediate
Convolutional Neural Network import torch import torch.nn as nn import torchvision import torchvisio ...