How to change default time zone in MySQL?

Is it possible to change the time zone in MySQL?

Yes we can change the default time zone in MySQL via command-line. We can’t change the time zone for a single DB, it’s a global change. To change this feature, you must have the root privilege to the server. We have to edit the MySQL configuration file to change the time zone of MySQL server from its default.

By default the MySQL server time is same as the SYSTEM time. We can check this by using the following commands:

4 thoughts on “How to change default time zone in MySQL?”

Thank you so much! I had to open thousand tabs of my browser until I get here! I am using Windows and changing the file /mysql/my.ini after the section [mysqld] putting this one line code ‘default-time-zone=”+00:00″‘ This saved my life!