Navicat 连接 Mysql 时错误:2059-Authentication plugin ‘caching_sha_password‘ cannot be loaded.

MySQL8以上版本登录账户加密方式为:【caching_sha2_password】;

MySQL查看加密方式:show variables  like 'default_authentication_plugin';

MySQL查看所有用户的加密方式:select host,user,plugin from mysql.user;

 修改用户的加密方式为【mysql_native_password】:

alter user 'root'@'localhost' IDENTIFIED WITH mysql_native_password by 'root';

 注意:修改时如果出现 ERROR 1396 (HY000) : Operation alter  user failed for ...;

执行 flush privileges;

然后重新执行修改语句即可成功。

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
当使用Navicat Premium连接MySQL,出现错误2059 - authentication plugincaching_sha2_password’ cannot be loaded。这是因为Navicat Premium不支持使用"caching_sha2_password"加密方式登录MySQL。为了解决这个问题,我们需要修改用户登录账户的加密方式。 首先,在终端登录MySQL,执行命令`show variables like 'default_authentication_plugin';`,可以看到MySQL的默认加密方式为"caching_sha2_password"。然后,执行命令`select host,user,plugin from mysql.user;`,可以查看到root用户的加密方式也是"caching_sha2_password"。 为了修改用户登录账户的加密方式,执行命令`ALTER USER 'root'@'%' IDENTIFIED WITH mysql_native_password BY 'root';`。这里的'root'@'%'是根据你的user和host来写的,同'root'是你MySQL密码。然后,再次执行命令`select host,user,plugin from mysql.user;`,可以看到root用户的加密方式已经改为"mysql_native_password"。 现在,再次尝试连接测试,应该可以成功连接了。\[1\] 关于身份验证插件的选择,MySQL 8.0.4及以上版本默认使用"caching_sha2_password",而之前的版本使用"mysql_native_password"。这是因为"caching_sha2_password"使用SHA1哈希算法将密码存储到mysql.user表中,可以快速验证用户身份,但容易被破解。而"mysql_native_password"使用更安全的加密方式。\[2\] 如果需要修改身份认证插件为"mysql_native_password",可以登录MySQL并选择数据库,执行命令`ALTER USER 'root'@'localhost' IDENTIFIED WITH mysql_native_password BY '你的数据库密码';`,然后刷新权限。\[3\] #### 引用[.reference_title] - *1* [2059 - authentication plugin caching_sha2_password cannot be loaded](https://blog.csdn.net/qq_45675449/article/details/106868156)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^insert_down28v1,239^v3^insert_chatgpt"}} ] [.reference_item] - *2* [2059-Authentication plugincaching_sha2_password‘cannot be loaded](https://blog.csdn.net/weixin_41886421/article/details/129452198)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^insert_down28v1,239^v3^insert_chatgpt"}} ] [.reference_item] - *3* [MySQL - 2059 - Authentication plugincaching_sha2_password‘ cannot be loaded](https://blog.csdn.net/Dream_Weave/article/details/126128723)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^insert_down28v1,239^v3^insert_chatgpt"}} ] [.reference_item] [ .reference_list ]

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

流星雨洒满天空

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值