spring boot jdbc服务器时区值“耶路撒冷标准时间”无法识别

时间:2018-12-18 22:29:09

标签: java spring spring-boot jdbc spring-jdbc

这是我第一次在春季引导中使用jdbc,因此我遵循了本指南: https://spring.io/guides/gs/accessing-data-mysql/

一切都很好,直到我尝试编译它并得到此错误:

The server time zone value 'Jerusalem Standard Time' 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.

1 个答案:

答案 0 :(得分:1)

我认为您需要在spring.datasource.url = ...行上的application.properties中添加?serverTimezone = IST。

  

spring.datasource.url = jdbc:mysql:// localhost:3306 / db_example?serverTimezone = IST