错误原因:mysql识别时区出现错误,这是因为访问的url中没有指定时区为UTC
出错误的url:
spring.datasource.url=jdbc:mysql://127.0.0.1:3306/springbootdemo?useUnicode=true&characterEncoding=utf8
在后面添加时区的参数数即可:
spring.datasource.url=jdbc:mysql://127.0.0.1:3306/springbootdemo?useUnicode=true&characterEncoding=utf8&serverTimezone=UTC