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

本站中文解释

time_zone 变量定义系统使用的时区。系统默认情况下,time_zone 设置为 PRC,即北京时间。要修改 time_zone 变量,可以在my.cnf 中进行设置,例如:

[mysqld]
time_zone=’-08:00′

或者,可以使用 set global 语句修改 time_zone。

SET GLOBAL time_zone = ‘-08:00’;

官方英文解释

time_zone

System Variable time_zone
Scope Global, Session
Dynamic Yes
Type String
Default Value SYSTEM
Minimum Value -12:59
Maximum Value +13:00

The current time zone. This variable is used to initialize the
time zone for each client that connects. By default, the
initial value of this is 'SYSTEM' (which
means, use the value of
system_time_zone
).
The value can be specified explicitly at server startup with
the --default-time-zone option.
See Section 5.1.13, “MySQL Server Time Zone Support”.

Note

If set to SYSTEM, every MySQL function
call that requires a time zone calculation makes a system
library call to determine the current system time zone. This
call may be protected by a global mutex, resulting in
contention.


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