大叔经验分享(72)mysql时区

查看当前时区

> show variables like '%time_zone%';
+------------------+--------+
| Variable_name    | Value  |
+------------------+--------+
| system_time_zone | UTC    |
| time_zone        | SYSTEM |
+------------------+--------+
2 rows in set (0.00 sec)

临时修改时区

> set time_zone = '+8:00';
Query OK, 0 rows affected (0.00 sec)

彻底修改时区

# vi /etc/my.cnf

[mysqld]

default-time_zone = '+8:00'

 

posted @ 2019-06-20 11:06  匠人先生  阅读(179)  评论(0编辑  收藏  举报