错误一:版本之争
依赖数据库与本机数据版本一致即可
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>8.0.11</version>
</dependency>
错误二:驱动不兼容
driverClass="com.mysql.jdbc.Driver"
driverClass="com.mysql.cj.jdbc.Driver"
错误三:useSSL
错误
javax.net.ssl.SSLException: closing inbound before receiving peer's close_notify
解决
添加useSSL=false
connectionURL="jdbc:mysql://localhost:3306/数据库?useSSL=false
错误四:serverTimezone
错误
java.sql.SQLException: The server time zone value ‘Öйú±ê׼ʱ¼ä’ is unrecognized or represents more
解决
单用&会报错,用;无法识别,所以使用&
connectionURL="jdbc:mysql://localhost:3306/数据库?useSSL=false&serverTimezone=GMT"