3、修改:mysql 的时区在东4区,web服务器的时区在东8区
在url后加上&serverTimezone=GMT%2B8
更改前代码
driverClass=com.mysql.jdbc.Driver url=jdbc:mysql://localhost:3306/test?useUnicode=true&characterEncoding=UTF-8 user=root password=123456
更改后代码:
driverClass=com.mysql.jdbc.Driver url=jdbc:mysql://localhost:3306/test?useUnicode=true&characterEncoding=UTF-8&serverTimezone=GMT%2B8 user=root password=1234564、serverTimeZone 的作用
serverTimeZone的作用就是指定web服务器和mysql服务器的会话期间的mysql服务器时区,就是临时指定mysql服务器的时区
参考网站



