DBeaver连接MySQL报错:Unable to load authentication plugin ‘caching_sha2_password‘.

问题:

DBeaver连接MySQL时提示:Unable to load authentication plugin 'caching_sha2_password'.
原因:mysql8之前的版本使用的密码加密规则是mysql_native_password,但是在mysql8则是caching_sha2_password,所以需要修改密码加密规则。

解决办法:

1.打开管理员cmd
2.mysql -u root -p后输入密码,进入 myqsql客户端
在这里插入图片描述

3.输入use mysql回车
在这里插入图片描述
4. 输入select user,host,plugin,authentication_string from user;
可以看到如下界面
在这里插入图片描述
5.输入alter user 'root' @'localhost' identified with mysql_native_password by '123456';(其中123456记得替换为你自己的密码)
在这里插入图片描述
运行完毕后再次打开DBeaver连接成功

  • 1
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
连接本地MySQL数据库时出现了"Unable to load authentication plugin 'caching_sha2_password'"的错误提示。这个错误是由于MySQL 8.0版本引入了一个新的身份验证机制caching_sha2_password,而你的MySQL客户端无法加载这个插件导致的。 为了解决这个问题,你可以采取两种方式之一: 1. 安装MySQL 8.0或更新版本的客户端,这些版本的客户端已经支持新的身份验证机制caching_sha2_password。你可以通过访问MySQL的官方网站下载最新版本的MySQL客户端,并使用它来连接MySQL数据库。 2. 修改MySQL 8.0的密码加密方式。你可以按照以下步骤进行操作: a. 以管理员身份登录到MySQL服务器。 b. 执行以下命令来修改密码加密方式: ALTER USER 'username'@'localhost' IDENTIFIED WITH mysql_native_password BY 'password'; 其中,'username'是你要连接MySQL的用户名,'localhost'是你要连接的主机名,'password'是你要设置的密码。 c. 刷新权限使修改生效: FLUSH PRIVILEGES; d. 然后你就可以使用修改后的密码连接MySQL数据库了。 通过以上两种方式之一,你应该能够成功解决"Unable to load authentication plugin 'caching_sha2_password'"的问题并连接到本地MySQL数据库。<span class="em">1</span><span class="em">2</span><span class="em">3</span> #### 引用[.reference_title] - *1* [DBeaver连接MySQL报错Unable to load authentication plugincaching_sha2_password‘.](https://blog.csdn.net/momomuabc/article/details/128574508)[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^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 33.333333333333336%"] - *2* [问题:MySQL 报错 Unable to load authentication plugincaching_sha2_password‘ 的解决方案](https://blog.csdn.net/qq_36722955/article/details/128720577)[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^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 33.333333333333336%"] - *3* [mysql8用navicat可视化连接报错加密方式错误](https://download.csdn.net/download/qq_41975509/11117766)[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^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 33.333333333333336%"] [ .reference_list ]
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值