一:MySQL修改数据库时区
1、首先Xshell登陆服务器
2、在服务器上登陆数据库:mysql -u 账号 -p 密码;
3、查看数据库时区:show variables like “%time_zone%”;
![MySQL通过xshell登陆数据库修改数据库时区_第1张图片](http://img.e-com-net.com/image/info8/c45222f1ddea4414a52ff01a880b7101.png)
4、–修改当前会话时区,退出msql后 time_zone 会恢复成修改前的值 set time_zone = ‘+8:00’;
![MySQL通过xshell登陆数据库修改数据库时区_第2张图片](http://img.e-com-net.com/image/info8/37460a3029584dcc827047fbae4d42f5.png)
5、—-修改全局会话时区
mysql> set global time_zone = ‘+8:00’;
mysql> set time_zone = ‘+8:00’;
mysql> flush privileges;
![MySQL通过xshell登陆数据库修改数据库时区_第3张图片](http://img.e-com-net.com/image/info8/dc17705b4d8e4bfb9f1c5d2190dca848.png)