Mysql

关注公众号 jb51net

关闭
首页 > 数据库 > Mysql > MySQL caching_sha2_password could not be loaded

SQLyog错误号码MySQL plugin caching_sha2_password could not be loaded的解决方法

作者:落月爱学习

这篇文章主要介绍了SQLyog错误号码 plugin caching_sha2_password could not be loaded的解决方法,需要的朋友可以参考下

问题描述:

SQLyog错误号码 plugin caching_sha2_password could not be loaded

原因分析: MySQL新版默认使用caching_sha2_password作为身份验证插件,而旧版是使用mysql_native_password

当连接MySQL时报错“plugin caching_sha2_password could not be loaded”时,可换回旧版插件。

解决方案: 远程命令行登录mysql

mysql -hlocalhost -uroot -proot -P3306

在这里插入图片描述

操作mysql数据库命令:

use mysql;

查看用户名使用的身份验证插件:

mysql> select Host,User,plugin from mysql.user;

修改root用户的身份验证插件

本地连接:

alter user root@localhost identified with mysql_native_password by '123456';
FLUSH PRIVILEGES;

远程连接:

alter user root@'%' identified with mysql_native_password by '123456';
FLUSH PRIVILEGES;

在这里插入图片描述

4.最后成功

在这里插入图片描述

远程连接MYSQL错误“PLUGIN CACHING_SHA2_PASSWORD COULD NOT BE LOADED”的解决办法

1、 进入MYSQL依次执行如下命令

# 本地mysql
# 修改加密规则(非必须)
alter user 'root'@'localhost' identified by '123456' password expire never;
# 更新用户的密码
alter user 'root'@'localhost' identified with mysql_native_password by '123456';
# 刷新权限
flush privileges;
# 重置密码(==非必须==)
alter user 'root'@'localhost' identified by '123456';
# 远程mysql(linux,docker中)
# 如果你需要使用远程登录,将localhost 改为 %,下面的‘123456'使用你自己的密码
# 修改加密规则(非必须)
alter user 'root'@'%' identified by '123456' password expire never;
# 更新用户的密码
alter user 'root'@'%' identified with mysql_native_password by '123456';
# 刷新权限
flush privileges;
# 重置密码(==非必须==)
alter user 'root'@'%' identified by '123456';

其中123456换成自己的密码。

2、查看修改结果

SELECT Host, User, plugin from mysql.user;

在这里插入图片描述

到此这篇关于SQLyog错误号码MySQL plugin caching_sha2_password could not be loaded的文章就介绍到这了,更多相关MySQL caching_sha2_password could not be loaded内容请搜索脚本之家以前的文章或继续浏览下面的相关文章希望大家以后多多支持脚本之家!

您可能感兴趣的文章:
阅读全文