MySQL server logs entries with different time than system or mysql itself:
mysql> select @@global.time_zone;
+--------------------+
| @@global.time_zone |
+--------------------+
| SYSTEM |
+--------------------+
mysql> select NOW();
+---------------------+
| NOW() |
+---------------------+
| 2016-02-24 10:47:30 |
+---------------------+
# /var/log/mysql/mysql_queries.log
2016-02-24T18:47:11.191126Z 2 Connect root@localhost on using Socket
2016-02-24T18:47:11.191421Z 2 Query select @@version_comment limit 1
2016-02-24T18:47:16.769493Z 2 Query select @@global.time_zone
2016-02-24T18:47:30.503214Z 2 Query select NOW()
Timestamp seems synced with log:
mysql> show variables;
timestamp | 1456339753.062182 # 18:47
log_timestamps | UTC
Solution was super simple: look through the variables and try to locate relevant:
So I changed it to 'SYSTEM':
Time in log switched from 18:54 to 10:54 as should.
From MySQL docs:
If you want to keep the change persistant after mysql restar or a reboot put this into your my.cnf file: