EN
The server time zone value 'Central European Standard Tim' is unrecognized or represents more than one time zone.
10 points
During executing my Java program with MySQL JDBC connection the following exception occured.
Exception message:
The server time zone value 'Central European Standard Tim' 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.
Full stack trace:
xxxxxxxxxx
1
java.sql.SQLException: The server time zone value 'Central European Standard Tim' 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.
2
at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:129)
3
at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:97)
4
at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:89)
5
at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:63)
6
at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:73)
7
at com.mysql.cj.jdbc.exceptions.SQLExceptionsMapping.translateException(SQLExceptionsMapping.java:76)
8
at com.mysql.cj.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:836)
9
at com.mysql.cj.jdbc.ConnectionImpl.<init>(ConnectionImpl.java:456)
10
at com.mysql.cj.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:246)
11
at com.mysql.cj.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:199)
12
at java.sql.DriverManager.getConnection(Unknown Source)
13
at java.sql.DriverManager.getConnection(Unknown Source)
14
at com.dirask.examples.Program.main(Program.java:32)
15
Caused by: com.mysql.cj.exceptions.InvalidConnectionAttributeException: The server time zone value 'Central European Standard Tim' 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.
16
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
17
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
18
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
19
at java.lang.reflect.Constructor.newInstance(Unknown Source)
20
at com.mysql.cj.exceptions.ExceptionFactory.createException(ExceptionFactory.java:61)
21
at com.mysql.cj.exceptions.ExceptionFactory.createException(ExceptionFactory.java:85)
22
at com.mysql.cj.util.TimeUtil.getCanonicalTimezone(TimeUtil.java:132)
23
at com.mysql.cj.protocol.a.NativeProtocol.configureTimezone(NativeProtocol.java:2121)
24
at com.mysql.cj.protocol.a.NativeProtocol.initServerSession(NativeProtocol.java:2145)
25
at com.mysql.cj.jdbc.ConnectionImpl.initializePropsFromServer(ConnectionImpl.java:1310)
26
at com.mysql.cj.jdbc.ConnectionImpl.connectOneTryOnly(ConnectionImpl.java:967)
27
at com.mysql.cj.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:826)
28
... 6 more
Driver connection url serverTimezone=UTC
paramter should be added.
Example:
xxxxxxxxxx
1
jdbc:mysql://127.0.0.1/my_database_name?serverTimezone=UTC