连接数据库报错
依赖问题
Unable to load authentication plugin 'caching_sha2_password'.
MYSQL8.0以上
开始是用的是
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>5.1.32</version>
</dependency>
改为下面这个就好了
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>8.0.16</version>
</dependency>
驱动要加cj
jdbc.driver=com.mysql.cj.jdbc.Driver
时区问题
com.mysql.cj.exceptions.InvalidConnectionAttributeException: The server time zone value '?й???????' is unrecognized or represents more than one time zone. You must configure either the server or JDBC driver (via the serverTimezone configuration property) to use a more specifc time zone value if you want to utilize time zone support.
添加serverTimezone=UTC
jdbc.url=jdbc:mysql:///test?useUnicode=true&characterEncoding=utf-8&serverTimezone=UTC