java.lang.ClassNotFoundException:com.mysql.cj.jdbc.Driver
或
java.sql.SQLException:Unableto load authentication plugin’caching_sha2_password’.
主要原因8.x版本的验证模块和之前版本不同:
5.x版本是:default_authentication_plugin=mysql_native_password
8.x版本就是:default_authentication_plugin=caching_sha2_password
解决方法
更改依赖,改为
<dependency>
<groupId>mysql</groupId