首页
学习
活动
专区
圈层
工具
发布
社区首页 >专栏 >连接数据库报错Unable to load authentication plugin caching_sha2_password

连接数据库报错Unable to load authentication plugin caching_sha2_password

作者头像
chenchenchen
发布2020-05-26 17:17:06
发布2020-05-26 17:17:06
5.4K0
举报
文章被收录于专栏:chenchenchenchenchenchen

报错Exception during pool initialization.

java.sql.SQLException: Unable to load authentication plugin 'caching_sha2_password'.

报错与数据库有关的,应该是从MySQL 8.0.4开始, 默认的认证插件从mysql_native_password 变为caching_sha2_password.

参考https://dev.mysql.com/doc/refman/8.0/en/caching-sha2-pluggable-authentication.html,创建新用户和密码

参考sql: CREATE USER 'sha2user'@'localhost'IDENTIFIED WITH caching_sha2_password BY 'password';

root账号修改为caching_sha2_password的任然不行。

进入mysql命令行,使用如下命令解决:

代码语言:javascript
复制
ALTER USER 'yourusername'@'localhost' IDENTIFIED WITH mysql_native_password BY 'youpassword';
本文参与 腾讯云自媒体同步曝光计划,分享自作者个人站点/博客。
原始发表:2020/04/05 ,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体同步曝光计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档