修改时区
- 全局设置:
vim /etc/mysql/my.cnf
1 2
| [mysqld] default-time_zone = '+8:00'
|
- 查询编辑器设置:
1 2 3
| set global time_zone = '+8:00'; set time_zone = '+8:00'; flush privileges;
|
查看是否生效:select now();
如果没有生效:重启mysql
1 2
| systemctl restart mysqld.service systemctl status mysqld.service
|