• 博客园logo
  • 会员
  • 周边
  • 新闻
  • 博问
  • 闪存
  • 赞助商
  • Chat2DB
    • 搜索
      所有博客
    • 搜索
      当前博客
  • 写随笔 我的博客 短消息 简洁模式
    用户头像
    我的博客 我的园子 账号设置 会员中心 简洁模式 ... 退出登录
    注册 登录
Aojin
博客园    首页    新随笔    联系   管理    订阅  订阅

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 |
 +-----------+------------------+-----------------------+

————————————————
版权声明:本文为CSDN博主「龙筱福」的原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接及本声明。
原文链接:https://blog.csdn.net/qq_38879615/article/details/89184653

posted on 2020-03-28 14:54  浅唱离骚  阅读(876)  评论(0)    收藏  举报
刷新页面返回顶部
博客园  ©  2004-2026
浙公网安备 33010602011771号 浙ICP备2021040463号-3