Rate This Document
Findability
Accuracy
Completeness
Readability

Time Zone Problem Occurs When Data Is Imported to MySQL

Symptom

The following time zone problem occurs when data is imported to the MySQL database:

ERROR: The server time zone value 'EDT' 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.

Key Process and Cause Analysis

The MySQL server cannot identify the default time zone EDT of the JDBC driver. In this case, set the time zone of the JDBC driver to UTC or the time zone of the MySQL server.

Conclusion and Solution

The following describes how to set the time zone of the JDBC driver to UTC.

  1. Open the my_mysql.properties file.
    vi my_mysql.properties
  2. Press i to enter the insert mode and add the following configuration to jdbc:
    serverTimezone=UTC

    See the following figure for the added content:

  3. Press Esc, type :wq!, and press Enter to save the file and exit.
  4. Run the data loading command again.
    ./runDatabaseBuild.sh my_mysql.properties