Server Time Zone

Debian time zone setting command:

dpkg-reconfigure tzdata

I prefer "UTC" on my server. Server time update command:


Add this line in crontab for periodical update

 59 *  *   *   *     /etc/network/if-up.d/ntpdate

This will update the server time every per hour.

First, check MySQL time zone with

show variables like 'system_time_zone';

and the command for synchronizing the time zone by system time zone

SET GLOBAL time_zone = 'SYSTEM';

another way, add this lines in /etc/mysql/conf.d/my.cnf file.