--查看数据库时区设置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;
原文地址:https://www.cnblogs.com/jinyin/p/10969725.html
时间: 2024-10-07 20:01:35