欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  IT编程

MySQL修改数据库时区

程序员文章站 2022-03-07 22:13:43
mysql> flush privileges; ......
--查看数据库时区设置
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;