简体   繁体   中英

timezone issue while connecting with mysql via spring boot, whats equivalent of Mitteleuropäische Zeit

I am getting following error while I am trying to connect with mysql:

Caused by: com.mysql.cj.exceptions.InvalidConnectionAttributeException: The server time zone value 'Mitteleuropäische Zeit' 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.

So as to receive below issue, I already went through MySQL JDBC Driver 5.1.33 - Time Zone Issue

I am using below mysql connector:

mysql mysql-connector-java 8.0.11

and application property is as below:

db2.datasource.url=jdbc:mysql://www<><>06/esystem?useSSL=false&zeroDateTimeBehavior=convertToNull&useUnicode=trueuseLegacyDatetimeCode=false&serverTimezone=GMT+1

I have used CET and GMT+1 in place of serverTimezone, but no luck. Any resolution point, what can be timezone placeholder for "Mitteleuropäische Zeit"

正如在这个问题中看到的,你应该使用IANA 时区格式,比如Europe/Berlin

db2.datasource.url=jdbc:mysql://www<><>06/esystem?useSSL=false&zeroDateTimeBehavior=convertToNull&useUnicode=trueuseLegacyDatetimeCode=false&serverTimezone=Europe/Berlin

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM