Home >Database >Mysql Tutorial >How to Change MySQL Server Time Zone from UTC to GMT 1 (or other Time Zones)?

How to Change MySQL Server Time Zone from UTC to GMT 1 (or other Time Zones)?

Barbara Streisand
Barbara StreisandOriginal
2024-11-30 16:40:11652browse

How to Change MySQL Server Time Zone from UTC to GMT 1 (or other Time Zones)?

MySQL Time Zone Modification

To modify your MySQL server's time zone from UTC to GMT 1, follow these steps:

Database Access via PHPMyAdmin

  1. Log in to your MySQL database through PHPMyAdmin.
  2. Navigate to the "SQL" tab in the database.
  3. Enter the following query in the execute SQL field:
SET GLOBAL time_zone = '+01:00';

SET time_zone = '+01:00';

Using Named Time Zones

For time zones that observe daylight saving time, use named time zones like this:

SET GLOBAL time_zone = 'Europe/London';

Addressing "Unknown or Incorrect Time Zone" Error

If you encounter the error "Unknown or incorrect time zone" for Linux systems, follow these steps:

  1. Open a terminal and type:
mysql_tzinfo_to_sql /usr/share/zoneinfo/|mysql -u root mysql -p
  1. Enter your MySQL root password.
  2. Run the time zone setting query again:
SET GLOBAL time_zone = timezone;

The above is the detailed content of How to Change MySQL Server Time Zone from UTC to GMT 1 (or other Time Zones)?. For more information, please follow other related articles on the PHP Chinese website!

Statement:
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