Skip to content

Instantly share code, notes, and snippets.

@jpcaparas
Last active July 15, 2022 02:07
Show Gist options
  • Save jpcaparas/c42bf2c96988628dc94ceae599a509bc to your computer and use it in GitHub Desktop.
Save jpcaparas/c42bf2c96988628dc94ceae599a509bc to your computer and use it in GitHub Desktop.
Change default timezone on MariaDB (brew installation)
# Take note of the current time zone:
sudo mysql -e "SELECT @@global.time_zone;"
# Run NOW() to see if that time zone is actually being used:
mysql -e "SELECT NOW();"
# Say for example, you want to turn it into UTC, run:
sudo mysql -e "SET GLOBAL time_zone = '+00:00';";
# Run NOW() again to see if the timezone has changed:
mysql -e "SELECT NOW();"
# Note: You may need to restart your SQL client for these changes to take effect.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment