Last active
March 26, 2020 19:14
-
-
Save luizcarraro/0e27fe12c2dd037bc3682de33490b59a to your computer and use it in GitHub Desktop.
Configurar MYSQL em UTC
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
1) Popule a tabela de timezones (sem esse passo nada funcionará) | |
$ mysql_tzinfo_to_sql /usr/share/zoneinfo/ | mysql -u root -p mysql | |
2) Edite o arquivo /etc/mysql/mysql.conf.d/mysqld.cnf | |
$ sudo vim /etc/mysql/mysql.conf.d/mysqld.cnf | |
3) Adicione a seguinte linha abaixo de [mysqld] | |
default-time-zone='UTC' | |
4) Reinicie o serviço do Mysql | |
$ sudo service mysql restart | |
5) Teste: | |
- O resultado do comando SQL | |
SELECT @@global.time_zone; | |
Deve ser: UTC |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment