您的位置: 首页 > IT文章 > java.sql.SQLException: Unable to load authentication plugin ‘caching_sha2_password‘.解决方法 问题描述: 解决方案: 原因分析: java.sql.SQLException: Unable to load authentication plugin ‘caching_sha2_password‘.解决方法 问题描述: 解决方案: 原因分析: 分类: IT文章 • 2022-07-22 21:53:21 此文转载自:https://blog.****.net/weixin_42891009/article/details/112258939 今天遇到数据库版本问题,原来是mysql5.6,升级到8.0,连接数据库就报错: Unable to load authentication plugin ‘caching_sha2_password’. 解决方案: 网上解决方案是修改数据库密码加密方式,不建议这么改 改两个地方: 1,修改pom.xml中的 mysql-connector-java 版本为8.x.xx 2,修改项目中数据库连接配置文件,改为 com.mysql.cj.jdbc.Driver 原因分析: mysql8.x的新特性密码加密方式是 caching_sha2_password mysql5.x密码加密使用的是 mysql_native_password