6
votes

When attempting to connect to a MySQL instance with DataGrip I am receiving a com.mysql.cj.exceptions.InvalidConnectionAttributeException exception:

The server time zone value 'XXX' 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.

Where XXX is my server's timezone (I also love the typo in the exception specifc). This error prevents me from creating a connection to the MySQL server. What is causing this issue?

2

2 Answers

17
votes

Your server's time zone is not specific. To get around this you need to set the serverTimezone property to a value that is specific. The simplest choice is to set it to UTC under the Advanced tab:

Advanced Tab serverTimeZone set

To be clear I'm not sure of the ramifications of this, but it did allow me to connect.

4
votes

I encountered the same problem, I tried to replace the driver with 5.1, and the connection was successful:

MySQL 5.1 driver