spring boot jdbc 服务器时区值 'Jerusalem Standard Time' 无法识别
spring boot jdbc The server time zone value 'Jerusalem Standard Time' is unrecognized
这是我第一次在 spring 引导中使用 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.
我认为您需要在 application.properties 行 spring.datasource.url = ...
中添加 ?serverTimezone=IST
spring.datasource.url=jdbc:mysql://localhost:3306/db_example?serverTimezone=IST
这是我第一次在 spring 引导中使用 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.
我认为您需要在 application.properties 行 spring.datasource.url = ...
中添加 ?serverTimezone=ISTspring.datasource.url=jdbc:mysql://localhost:3306/db_example?serverTimezone=IST