Home > Database > Mysql Tutorial > Why Does MySQL Return \'The Server Time Zone Value \'AEST\' is Unrecognized\'?

Why Does MySQL Return \'The Server Time Zone Value \'AEST\' is Unrecognized\'?

Mary-Kate Olsen
Release: 2024-12-06 16:59:17
Original
359 people have browsed it

Why Does MySQL Return

The Server Time Zone Value 'AEST' is Unrecognized or Represents More Than One Time Zone

When attempting to establish a connection to a MySQL database, you may encounter the following error:

The server time zone value 'AEST' 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.
Copy after login

This error occurs when the server's time zone configuration is not recognized by the JDBC driver. To resolve it, you need to configure the server or the JDBC driver to use a more specific time zone value.

Configure the Server

To configure the MySQL server's time zone, add the following line to your my.cnf configuration file:

default-time-zone = 'Australia/Melbourne'
Copy after login

Replace Australia/Melbourne with the appropriate time zone for your server.

Configure the JDBC Driver

If you prefer to configure the JDBC driver instead of the server, you can add the following property to your connection string:

serverTimezone = 'Australia/Melbourne'
Copy after login

For example, your updated connection URL would look like this:

jdbc:mysql://localhost:3306/parking_hib?useLegacyDatetimeCode=false&serverTimezone=Australia/Melbourne&useSSL=false
Copy after login

Be sure to replace Australia/Melbourne with the appropriate time zone for your location.

Note: The serverTimezone property is only supported by the MySQL Connector/J driver version 6.0.4 and later. If you are using an earlier version of the driver, you will need to upgrade to version 6.0.4 or later to use this solution.

The above is the detailed content of Why Does MySQL Return \'The Server Time Zone Value \'AEST\' is Unrecognized\'?. For more information, please follow other related articles on the PHP Chinese website!

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Articles by Author
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template