RTC / UTC在MySQL(MariaDB)服务器上是非常实用的。 我修好了 – 那么糟糕?

我捏作为一个公认的绿色服务器pipe理员。 我在MariaDB服务器上安装了一堆安全补丁,这些补丁的configuration不正确(而不是我),而且一段时间都没有得到补丁。 安装和重新启动后,我注意到所有的时钟都closures了一个小时。

timedatectlbuild议将RTC设置为UTC而不是当地时间,所以我做了。 然后我用ntpdate来更正RTC。

现在一切似乎都运行良好,但我是否在运行SQL数据库中搞砸了时间戳? 改变时间之前,我应该想到这一点,是的。 我login到一个Web CRM应用程序并浏览:上周做出的更改仍然具有正确的时间戳。 mariadb是否会自动检测并处理RTC更改?

mysql1:~ # date Mon Feb 8 11:34:04 CST 2016 mysql1:~ # hwclock --show Mon Feb 8 11:34:44 2016 -0.757576 seconds mysql1:~ # timedatectl Local time: Mon 2016-02-08 11:35:10 CST Universal time: Mon 2016-02-08 17:35:10 UTC RTC time: Mon 2016-02-08 11:35:17 Timezone: America/Chicago (CST, -0600) NTP enabled: n/a NTP synchronized: no RTC in local TZ: yes DST active: no Last DST change: DST ended at Sun 2015-11-01 01:59:59 CDT Sun 2015-11-01 01:00:00 CST Next DST change: DST begins (the clock jumps one hour forward) at Sun 2016-03-13 01:59:59 CST Sun 2016-03-13 03:00:00 CDT Warning: The RTC is configured to maintain time in the local timezone. This mode is not fully supported and will create various problems with time zone changes and daylight saving adjustments. If at all possible use RTC in UTC, by calling 'timedatectl set-local-rtc 0'. mysql1:~ # timedatectl set-local-rtc 0 mysql1:~ # timedatectl Local time: Mon 2016-02-08 11:36:24 CST Universal time: Mon 2016-02-08 17:36:24 UTC RTC time: Mon 2016-02-08 17:36:24 Timezone: America/Chicago (CST, -0600) NTP enabled: n/a NTP synchronized: no RTC in local TZ: no DST active: no Last DST change: DST ended at Sun 2015-11-01 01:59:59 CDT Sun 2015-11-01 01:00:00 CST Next DST change: DST begins (the clock jumps one hour forward) at Sun 2016-03-13 01:59:59 CST Sun 2016-03-13 03:00:00 CDT mysql1:~ # ntpdate ntp.uiuc.edu 8 Feb 10:40:03 ntpdate[26539]: step time server 130.126.24.44 offset -3591.072249 sec mysql1:~ # timedatectl Local time: Mon 2016-02-08 10:40:08 CST Universal time: Mon 2016-02-08 16:40:08 UTC RTC time: Mon 2016-02-08 17:40:00 Timezone: America/Chicago (CST, -0600) NTP enabled: n/a NTP synchronized: no RTC in local TZ: no DST active: no Last DST change: DST ended at Sun 2015-11-01 01:59:59 CDT Sun 2015-11-01 01:00:00 CST Next DST change: DST begins (the clock jumps one hour forward) at Sun 2016-03-13 01:59:59 CST Sun 2016-03-13 03:00:00 CDT