Java spring boot jdbc服务器时区值';耶路撒冷标准时间';未被承认
这是我第一次在spring boot中使用jdbc,因此我遵循以下指南: 在我尝试编译之前,一切看起来都很好,但出现了以下错误:Java spring boot jdbc服务器时区值';耶路撒冷标准时间';未被承认,java,spring,spring-boot,jdbc,spring-jdbc,Java,Spring,Spring Boot,Jdbc,Spring Jdbc,这是我第一次在spring boot中使用jdbc,因此我遵循以下指南: 在我尝试编译之前,一切看起来都很好,但出现了以下错误: 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
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.
我认为您需要在spring.datasource.url= spring.datasource.url=jdbc:mysql://localhost:3306/db_example?serverTimezone=IST
您使用的是哪个版本的mysql?@Jonathan Johx im使用的是mysql workbench 8.0我添加了一个解决方案,希望能够解决第二个选项修复了它,谢谢!你是怎么知道它的名字的?我试图搜索时区和时区格式,但没有找到任何有用的东西。我一做完测试就接受你的答案,以确定它是正确的。这里耶路撒冷是以色列的一部分,也请注意IST是一个模棱两可的时区代码,因为它用于以色列标准时间、爱尔兰标准时间和印度标准时间。