Home > Database > Mysql Tutorial > How Do I Change My MySQL Timezone from UTC to GMT 1?

How Do I Change My MySQL Timezone from UTC to GMT 1?

Susan Sarandon
Release: 2024-11-29 19:57:12
Original
484 people have browsed it

How Do I Change My MySQL Timezone from UTC to GMT 1?

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';
Copy after login

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
Copy after login

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!

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