Bug #86425 JDBC connection problem after change to DST
Submitted: 23 May 2017 10:17 Modified: 14 Sep 2017 7:47
Reporter: Kheiffer Lim Email Updates:
Status: Duplicate Impact on me:
None 
Category:Connector / J Severity:S3 (Non-critical)
Version: 5.7.17 OS:Red Hat (4.1.12-61.1.25.el7uek.x86_64)
Assigned to: CPU Architecture:Any
Tags: DST, jdbc, timezone

[23 May 2017 10:17] Kheiffer Lim
Description:
"The server time zone value 'CEST' 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."

Above error is received on application side when trying to use the application.
The error occurred after restarting the MySQL instance. It also happened that this is the first time we restarted the instance after changing to DST (CET to CEST).

time_zone variable value is set to SYSTEM and on OS level, time zone is CEST.
Nothing was changed on application side (specifically the connection string)

How to repeat:
Set time_zone variable to SYSTEM and run applcation.

Suggested fix:
We tried to fix this using below command but to no avail.
mysql_tzinfo_to_sql /usr/share/zoneinfo/Europe | mysql -u root -p mysql

The issue was fixed after setting the time_zone global variable to '+2:00'.

We need to know the reason why we received the error and if this is specific to this version of MySQL instance.
[23 May 2017 10:20] Kheiffer Lim
Hi All,

Correcting the command we tried to used to below:

mysql_tzinfo_to_sql /usr/share/zoneinfo | mysql -u root -p mysql
[14 Jun 2017 13:48] Chiranjeevi Battula
Hello Kheiffer,

Thank you for the bug report.
This is most likely duplicate of Bug #85816, please see the explanation by dev's ([21 Apr 23:44] Filipe Silva) in #85816.

Thanks,
Chiranjeevi.
[21 Jun 2017 9:28] Kheiffer Lim
Is this something specific with client version or database version? Because we have not encountered this error on other MySQL databases which was also hosted on servers affected by DST.

Clarification will be appreciated. Thanks.
[14 Sep 2017 7:47] Kheiffer Lim
Hello, can you give an update?
[27 Jun 18:28] Filipe Silva
This is a client side specific. It works like this since Connector/j 5.1.33.
[24 Jul 8:57] Claude Brisson
Here's a cleaner fix that doesn't imply modifying the JDBC URL.

First import the system timezones in mysql:

$ mysql_tzinfo_to_sql /usr/share/zoneinfo | mysql -u root mysql

Then set your default mysql server timezone in the server configuration file, for instance:

default-time-zone = Europe/Paris

and don't forget to restart mysql.