MySQL修改数据库时区
Posted jinyin
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了MySQL修改数据库时区相关的知识,希望对你有一定的参考价值。
--查看数据库时区设置
mysql> show variables like "%time_zone%"; +------------------+--------+ | Variable_name | Value | +------------------+--------+ | system_time_zone | UTC | | time_zone | SYSTEM | +------------------+--------+
--修改时区
mysql> set global time_zone = ‘+8:00‘; Query OK, 0 rows affected (0.00 sec) mysql> show variables like "%time_zone%"; +------------------+--------+ | Variable_name | Value | +------------------+--------+ | system_time_zone | UTC | | time_zone | SYSTEM | +------------------+--------+
--修改时区
mysql> set time_zone = ‘+8:00‘; Query OK, 0 rows affected (0.00 sec) mysql> show variables like "%time_zone%"; +------------------+--------+ | Variable_name | Value | +------------------+--------+ | system_time_zone | UTC | | time_zone | +08:00 | +------------------+--------+
mysql> flush privileges;
以上是关于MySQL修改数据库时区的主要内容,如果未能解决你的问题,请参考以下文章