1

I use springboot, maven, connector: mysql-connector-java-8.0.11 in local, system windows. I have this error,

java.sql.SQLException: The server time zone value 'Hora de verano GMT' 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.

I have modified in mysql file my.ini, I have put: timezone='UTC'. I have changed to mysql-connector-java-8.0.12, the same error. I have tried, 5.1.46, I have been other error.

Thank you

15
  • Please, show me your code. Check if you are using a prepared statement and setting the date correctly. What country is in the summer time? Commented Sep 21, 2018 at 15:01
  • I don't have code just entity with these declarations @Temporal(TemporalType.DATE) private Date updated_at; @Temporal(TemporalType.DATE) private Date created_at; and repository just insert without date Commented Sep 21, 2018 at 15:30
  • Have you tried @Temporal(TemporalType.TIMESTAMP)? Please check this -> stackoverflow.com/questions/25333711/… Commented Sep 21, 2018 at 15:42
  • no, but in my dbb the type is Date, no timestamp Commented Sep 21, 2018 at 15:44
  • You may check your MySQL configuration, since looks like you have summer time on that. It is possibly something native, not a Java mistake (just guessing). Commented Sep 21, 2018 at 15:47

1 Answer 1

8

I found the answer.

spring.jpa.hibernate.ddl-auto=update spring.datasource.url=jdbc:mysql://localhost:3306/database?useSSL=false&useLegacyDatetimeCode=false&serverTimezone=UTC spring.datasource.username=user spring.datasource.password=passwprd spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver spring.jpa.database-platform=org.hibernate.dialect.MySQL5InnoDBDialect 

Thanks

Sign up to request clarification or add additional context in comments.

1 Comment

Simply adding ?serverTimezone=UTC worked for me.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.