Skip to content

Instantly share code, notes, and snippets.

@kevinmichaelchen
Forked from dotspencer/utc-timezone-mysql.md
Last active June 15, 2018 17:21
Show Gist options
  • Save kevinmichaelchen/c55e975cc0fc7a7943c4565bdf15a7f0 to your computer and use it in GitHub Desktop.
Save kevinmichaelchen/c55e975cc0fc7a7943c4565bdf15a7f0 to your computer and use it in GitHub Desktop.
Setting UTC timezone with homebrew installed mysql

Edit /usr/local/etc/my.cnf

Add the following below [mysqld]

default-time-zone='+00:00'

Restart mysql with brew services restart mysql

mysql> SELECT @@system_time_zone, @@global.time_zone, @@session.time_zone;
+--------------------+--------------------+---------------------+
| @@system_time_zone | @@global.time_zone | @@session.time_zone |
+--------------------+--------------------+---------------------+
| EDT                | +00:00             | +00:00              |
+--------------------+--------------------+---------------------+
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment