如何将MySQL数据库更改为UTC? [英] How to change a MySQL database to UTC?

查看:978
本文介绍了如何将MySQL数据库更改为UTC?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Windows 7上,对这个数据库东西有些陌生.我尝试在Google上搜索如何将时区从我的系统更改为UTC,但是文档有些高级,因此我不太确定如何更改此字段.

解决方案

在my.ini文件的[mysqld]部分下,添加以下行:

default-time-zone = '+00:00'

重新启动服务器. 您还可以在运行时通过命令行使用

进行设置

mysql> SET GLOBAL time_zone = '+00:00';

MySql的文档

I'm on Windows 7 and I'm a bit new to this database stuff. I tried searching on Google for how to change the timezone from my system to UTC but the documents are somewhat advanced and I'm not too sure how to change this field.

解决方案

In your my.ini file, under the [mysqld] section, add the following line:

default-time-zone = '+00:00'

Restart the server. You could also set it at runtime from the command line with

mysql> SET GLOBAL time_zone = '+00:00';

The documentation from MySql

这篇关于如何将MySQL数据库更改为UTC?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆