MySQL Time Zones

前端 未结 6 1462
轻奢々
轻奢々 2020-11-29 04:16

Is there an exhaustive list of MySQL Time Zones?

It seems that the valid values for time_zone in MySQL settings are dependent on the host Operating Syst

6条回答
  •  心在旅途
    2020-11-29 04:43

    It should be noted that the MySQL timezone variable's default setting is SYSTEM at MySQL startup. The SYSTEM value is obtained from the operating system's GLOBAL time_zone environment variable.

    MySQL's default timezone variable can be initialised to a different value at start-up by providing the following command line option:

    --default-time-zone=timezone
    

    Alternatively, if you are supplying the value in an options file, you should use the following syntax to set the variable:

    --default-time-zone='timezone'
    

    If you are a MySQL SUPER user, you can set the SYSTEM time_zone variable at runtime from the MYSQL> prompt using the following syntax:

    SET GLOBAL time_zone=timezone;
    

    MySQL also supports individual SESSION timezone values which defaults to the GLOBAL time_zone environment variable value. To change the session timezone value during a SESSION, use the following syntax:

    SET time_zone=timezone;
    

    In order to interrogate the existing MYSQL timezone setting values, you can execute the following SQL to obtain these values:

    SELECT @@global.time_zone, @@session.time_zone;
    

提交回复
热议问题