How to change MySQL Server time zone?

主宰稳场 提交于 2019-12-19 03:26:13

问题


I am administrating a MySQL Server. It is installed on a ubuntu server. Recently I discovered, that the ubuntu server was set on a false timezone. I corrected that through terminal by the command dpkg-reconfigure tzdate. Now I want the MySQL Server to adapt this setting. Is this possible?


回答1:


In your /etc/mysql/mysql.conf or wherever it is, check out the default-time-zone




回答2:


You need to update mysql tables on server for supporting the timezones names. Use shell command on server:

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



回答3:


In order to change timestamp on mysql , you can use the below steps.

Connect to mysql server. mysql -u root -p TYPE PASSWORD

SET GLOBAL time_zone = '+5:30';

Restart Mysql server by issuing the below query

service mysqld stop service mysqld start



来源:https://stackoverflow.com/questions/6019507/how-to-change-mysql-server-time-zone

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!