MySQL Variables system_time_zone 数据库 参数变量解释及正确配置使用

本站中文解释

system_time_zone参数控制MySQL使用的服务器时区。MySQL可用的时区是根据系统的时区而定的,而这个参数的默认值是你操作系统的默认时区。

要设置MySQL的system_time_zone参数,需要执行以下命令:

SET GLOBAL system_time_zone = ”;

例如,如果要将MySQL的系统时区设置为“中国标准时间”,可以执行以下命令:

SET GLOBAL system_time_zone = ‘China Standard Time’;

官方英文解释

system_time_zone

System Variable system_time_zone
Scope Global
Dynamic No
Type String

The server system time zone. When the server begins executing,
it inherits a time zone setting from the machine defaults,
possibly modified by the environment of the account used for
running the server or the startup script. The value is used to
set system_time_zone. To
explicitly specify the system time zone, set the
TZ environment variable or use the
--timezone option of the
mysqld_safe script.

The system_time_zone variable
differs from the time_zone
variable. Although they might have the same value, the latter
variable is used to initialize the time zone for each client
that connects. See Section 5.1.13, “MySQL Server Time Zone Support”.


数据运维技术 » MySQL Variables system_time_zone 数据库 参数变量解释及正确配置使用