估计是用了mysql8.0等高版本导致的
解决办法
在配置URL时加上serverTimezone=UTC
比如,用 ? 连接
String url="jdbc:mysql://localhost:3306/test?serverTimezone=UTC";
如果URL用了allowMultiQueries=true,则要用 & 连接
String url="jdbc:mysql://localhost:3306/test?allowMultiQueries=true&serverTimezone=UTC";