2059 – 身份验证插件’caching_sha2_password’-navicat连接异常

2059 – 身份验证插件’caching_sha2_password’-navicat连接异常


当前位置: Home » material » Archit » 2059 – 身份验证插件’caching_sha2_password’-navicat连接异常

这个问题是由于我的MySQL的的的更新至8版本以上了,在安装的时候我并没有指定用户登入密码加密方式,所以默认被设置为caching_sha2_password 解决方法: 
mysql> show variables like 'default_authentication_plugin'; 
 +-------------------------------+-----------------------+ 
 | Variable_name                 | Value                | 
 +-------------------------------+-----------------------+  
 | default_authentication_plugin |caching_sha2_password |
 +-------------------------------+-----------------------+  
1 row in set (0.03 sec)  
// 查看本地mysql用户的信息  
mysql> select host,user,plugin from mysql.user; 
 +-----------+------------------+----------------------+ 
 | host      | user             | plugin               | 
 +-----------+------------------+-----------------------+
 | localhost | mysql.infoschema | caching_sha2_password| 
 | localhost | mysql.session    | caching_sha2_password|  
 | localhost | mysql.sys        | caching_sha2_password|
 | localhost | root             | caching_sha2_password| 
 +-----------+------------------+-----------------------+ 
4 rows in set (0.00 sec)  
// 注意 caching_sha2_password, 只修改root的密码加密方式就可以了 
mysql> ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY '123456';  
Query OK, 0 rows affected (0.04 sec) 
mysql> select host,user,plugin from mysql.user; 
+-----------+------------------+-----------------------+  
| host      | user             | plugin                | 
+-----------+------------------+-----------------------+  
| localhost | mysql.infoschema | caching_sha2_password | 
| localhost | mysql.session    | caching_sha2_password | 
| localhost | mysql.sys        | caching_sha2_password | 
| localhost | root             | mysql_native_password | 
 +-----------+------------------+-----------------------+ 
 4 rows in set (0.00 sec)
mysql> show variables like 'default_authentication_plugin'; 
 +-------------------------------+-----------------------+ 
 | Variable_name                 | Value                | 
 +-------------------------------+-----------------------+  
 | default_authentication_plugin |caching_sha2_password |
 +-------------------------------+-----------------------+  
1 row in set (0.03 sec)  
// 查看本地mysql用户的信息  
mysql> select host,user,plugin from mysql.user; 
 +-----------+------------------+----------------------+ 
 | host      | user             | plugin               | 
 +-----------+------------------+-----------------------+
 | localhost | mysql.infoschema | caching_sha2_password| 
 | localhost | mysql.session    | caching_sha2_password|  
 | localhost | mysql.sys        | caching_sha2_password|
 | localhost | root             | caching_sha2_password| 
 +-----------+------------------+-----------------------+ 
4 rows in set (0.00 sec)  
// 注意 caching_sha2_password, 只修改root的密码加密方式就可以了 
mysql> ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY '123456';  
Query OK, 0 rows affected (0.04 sec) 
mysql> select host,user,plugin from mysql.user; 
+-----------+------------------+-----------------------+  
| host      | user             | plugin                | 
+-----------+------------------+-----------------------+  
| localhost | mysql.infoschema | caching_sha2_password | 
| localhost | mysql.session    | caching_sha2_password | 
| localhost | mysql.sys        | caching_sha2_password | 
| localhost | root             | mysql_native_password | 
 +-----------+------------------+-----------------------+ 
 4 rows in set (0.00 sec)

  • 2
    点赞
  • 7
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值