java.sql.SQLException: Unable to load authentication plugin 'caching_sha2_passwo
mac 11.6.1
mysql 8.0.29java.sql.SQLException: Unable to load authentication plugin 'caching_sha2_password'.
改两个地方:
1,修改pom.xml中的 mysql-connector-java 版本为8.x.xx(比如;8.0.11)原来是5.1.38
2,修改项目中数据库连接配置文件,com.mysql.jdbc.Driver改为 com.mysql.cj.jdbc.Driver
原因分析:
mysql8.x的新特性密码加密方式是 caching_sha2_password
mysql5.x密码加密使用的是 mysql_native_password
修改好之后,别忘了在IDEA里面reimport pom一下
原文链接:https://blog.csdn.net/weixin_42891009/article/details/112258939