Changing MySQL Timezone
The question arises on how to adjust a MySQL timezone from UTC to GMT 1. The host has provided a reference to MySQL's documentation, leaving the user slightly bewildered.
Addressing this issue, Umar suggests utilizing the following command:
mysql> SET GLOBAL time_zone = 'America/New_York';
Employing the designated timezone is crucial for managing timezones that involve daylight saving adjustments. However, certain Linux versions may encounter an "unknown or incorrect time zone" error.
To resolve this, execute the following command:
mysql_tzinfo_to_sql /usr/share/zoneinfo/|mysql -u root mysql -p
Enter your MySQL root password, not your Linux root password. This will update MySQL with definitions from your zoneinfo. You can then execute the "SET GLOBAL time_zone" command to adjust your timezone to your desired value.
The above is the detailed content of How Do I Change My MySQL Timezone from UTC to GMT 1?. For more information, please follow other related articles on the PHP Chinese website!