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.
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'
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'
For example, your updated connection URL would look like this:
jdbc:mysql://localhost:3306/parking_hib?useLegacyDatetimeCode=false&serverTimezone=Australia/Melbourne&useSSL=false
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!