Database migration to MySQL fails - java.sql.SQLException: The server time zone value CDT is unrecognized or represents more than one time zone

Still need help?

The Atlassian Community is here for you.

Ask the community

Platform notice: Server and Data Center only. This article only applies to Atlassian products on the server and data center platforms.


When migrating to an external MySQL database you are presented with this error message:

Unable to connect to MySQL database jdbc:mysql://localhost:3306/<application>:
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 specific time zone value if you want to utilize time zone support. Couldn't connect to the database.


This is a bug affecting the mysql-connector-java from version 5.1.33 up to 5.1.37:


Add the useJDBCCompliantTimezoneShift=trueuseLegacyDatetimeCode=false, and the serverTimezone=UTC to the jdbc url in the $BITBUCKET_HOME/shared/ file. If this file doesn't exist, create it and ensure it looks similar to this:


Replace <bitbucketuser> with the user you set up for Bitbucket Server to access the database and <your_password_for_the_db> with the actual password the bitbucketuser uses to access the database.

If the error persists after a restart of the application, ensure you are using a more recent version of the connector, specifically 5.1.39.

Last modified on Sep 15, 2016

Was this helpful?

Provide feedback about this article
Powered by Confluence and Scroll Viewport.