Last active
February 19, 2023 03:14
-
-
Save Bachsau/2ea86b71a26e0839d8eb048ce68968d1 to your computer and use it in GitHub Desktop.
Single command to import system timezones into MySQL
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh -eu | |
if [ $(id -u) -ne 0 ]; then | |
echo 'Only root can do this' >&2 | |
exit 1 | |
fi | |
mysql_tzinfo_to_sql /usr/share/zoneinfo | mysql mysql | |
mysql_tzinfo_to_sql --leap /etc/localtime | mysql mysql | |
systemctl restart mysql.service |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment