Skip to content

Instantly share code, notes, and snippets.

@pvgomes
Last active April 23, 2020 21:07
Show Gist options
  • Save pvgomes/278b5812bd2c6d009cf78bd9c89fe579 to your computer and use it in GitHub Desktop.
Save pvgomes/278b5812bd2c6d009cf78bd9c89fe579 to your computer and use it in GitHub Desktop.
fix ubuntu and mysql timezone

fix ubuntu timezone

sudo dpkg-reconfigure tzdata

fix mysql timezone

If you're struggling with the error:

Error saying “server time zone value 'EDT' is unrecognized…” when trying to make connection to MySQL

1 - update zone info

mysql_tzinfo_to_sql /usr/share/zoneinfo | mysql -u root mysql -p

2 - update mysql configuration

mysql -uUSER -p
SELECT @@global.time_zone;
SET time_zone='America/Sao_Paulo';
SET @@global.time_zone = '+3:00';
SET @@session.time_zone = "+3:00";

3 - check server current timezone

timedatectl ref

still with some error? maybe it will be a sync problem, follow this steps

apt install ntp ntpdate
ntpdate pool.ntp.org
hwclock --systohc

ref

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment