4

When trying to connect to a mySQL on my website I get this message java.sql.SQLException:

The server time zone value 'CDT' 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 did try using

serverTimezone=CDT

but I get this java.sql.SQLException:

No timezone mapping entry for 'CDT'

Gord Thompson
  • 116,920
  • 32
  • 215
  • 418
  • You may have to do some work to configure your MySQL timezone tables, [see here](https://datawookie.netlify.com/blog/2017/08/setting-up-time-zones-in-mysql/). – Tim Biegeleisen Oct 20 '18 at 14:12

1 Answers1

3

CDT is not a valid timezone identifier. It's an abbreviation for a number of different timezones e.g. Central Daylight Time or Cuba Daylight Time.

Most likely you want to configure America/Chicago timezone if you are looking for American central time. You can check what values are available in your MySQL server by running select * from time_zone_name; query.

Karol Dowbecki
  • 43,645
  • 9
  • 78
  • 111
  • This is how it goes. I can add that if the default time zone in mysql version 8.0.20 was not set then java connector chooses(gets?) default parameter "system_time_zone" which is FLE Summer Time" here in Helsinki. In this case adding default-time-zone='Europe/Helsinki' to my.ini (in windows) repaired Java's mysql connection. – Tonecops Aug 20 '23 at 23:40