java.sql.SQLException时区

时间:2018-12-06 11:54:12

标签: java mysql spring spring-mvc spring-boot

当我去连接到我的数据库时,出现此错误,我尝试了一些修复,但没有任何效果 我正在使用Spring Boot和Java8

我尝试在春季附录中找到一个合适的地方,并做好工作 我尝试对我的应用程序类进行一些更改,但仍然无法解决

java.sql.SQLException: The server time zone value 'Hora estándar romance' 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.banner.location=classpath:banner.txt
spring.banner.image.invert=false

spring.jpa.hibernate.ddl-auto=update
spring.datasource.url=jdbc:mysql://localhost:3306/course
spring.datasource.username=root
spring.datasource.password=1111
spring.jpa.show-sql= true
spring.jpa.properties.hibermate.dialect=org.hibernate.dialect.MySQL8Dialect

1 个答案:

答案 0 :(得分:0)

尝试在spring.datasource.url

中添加以下参数
jdbc:mysql://localhost:3306/course?useLegacyDatetimeCode=false&serverTimezone=UTC

mysql-connector-java 6.0.4

一起使用

注意:将UTC替换为所需的时区

相关问题