I'm pinch hitting as an admittedly green server admin. I installed a bunch of security patches on a MariaDB server that had an incorrectly configured repo (not by me) and wasn't getting patches for a while. After install and reboot, I noticed all clocks were off by one hour.
timedatectl suggested setting the RTC to UTC instead of local time, so I did. Then I used ntpdate to correct the RTC.
Everything seems to be running fine now, but did I just screw up timestamps in the running SQL databases? I should have thought of this before changing the time, yes. I logged into a web CRM application and glanced around: a change made last week still has the correct timestamp. Does mariadb automatically detect and handle RTC changes?
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