Showing posts with label system_time_zone. Show all posts
Showing posts with label system_time_zone. Show all posts

2018/09/17

How to change the time zone setting of MySQL running on cloud server such as DigitalOcean

I ran into an issue with the time stamp of the data stored in the MySQL database running on DigitalOcean droplet. The time stamp is 8 hours off from my current time. This post is a quick summary of how to solve this issue.

Check the current local time setting of the LAMP server

Ref.: https://www.tecmint.com/check-linux-timezone/

So, the time zone of the server is set to UTC. It needs to be changed to my time zone so that the time stamp could be corrected.

wei48221@lamp-s-1vcpu-1gb-sfo2-01:/etc/mysql$ timedatectl
      Local time: Tue 2018-09-18 12:39:28 UTC
  Universal time: Tue 2018-09-18 12:39:28 UTC
        RTC time: Tue 2018-09-18 12:39:28
       Time zone: Etc/UTC (UTC, +0000)
 Network time on: yes
NTP synchronized: yes
 RTC in local TZ: no