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
Release: 2024-11-30 16:40:11
Original
686 people have browsed it

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

Using Named Time Zones

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

SET GLOBAL time_zone = 'Europe/London';
Copy after login

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
Copy after login
  1. Enter your MySQL root password.
  2. Run the time zone setting query again:
SET GLOBAL time_zone = timezone;
Copy after login

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!

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