Mysql

关注公众号 jb51net

关闭
首页 > 数据库 > Mysql > MySQL错误代码2058和2059

MySQL错误代码2058和2059的解决办法

作者:星光下的赶路人star

这篇文章主要介绍了MySQL错误代码2058和2059的解决办法,2058和2059的错误码核心都是你用的客户端工具和mysql版本的密码插件不匹配,下面就来介绍一下解决方法,感兴趣的可以了解一下

1. 前置理解

2.报错现象

Authentication plugin 'mysql_native_password' cannot be loaded
Authentication plugin 'caching_sha2_password' cannot be loaded

3.解决办法(敲重点!!!)

修改MySQL8的加密规则!!!

# 连接 mysql 服务器
mysql -u root -p
# 进入 mysql 数据库
mysql> use mysql;
# 查看 user 表
mysql> select user,host from user;
# 设置登录密码永不过期(password改为自己的)
mysql> alter user 'root'@'localhost' identified by 'password' password expire never;
mysql> alter user 'root'@'%' identified by 'password' password expire never;
# 修改加密规则(password改为自己的)
mysql> alter user 'root'@'localhost' identified with mysql_native_password by 'password';
mysql> alter user 'root'@'%' identified with mysql_native_password by 'password';
# 刷新权限
mysql> flush privileges;
# 退出
mysql> quit

到此这篇关于MySQL错误代码2058和2059的解决办法的文章就介绍到这了,更多相关MySQL错误代码2058和2059内容请搜索脚本之家以前的文章或继续浏览下面的相关文章希望大家以后多多支持脚本之家!

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