Aufwind
Aufwind

Reputation: 26238

How to change MySQL Server time zone?

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?

Upvotes: 4

Views: 21980

Answers (3)

Rizwan Basheer
Rizwan Basheer

Reputation: 137

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

Upvotes: 0

23W
23W

Reputation: 1530

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

Upvotes: 1

Henry
Henry

Reputation: 6620

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

Upvotes: 4

Related Questions