Friday, December 21, 2012

Change Time Zone in MySQL

By default, MySQL uses timestamp of server.  

To check this, run 
SELECT @@global.time_zone, @@session.time_zone;

which returns "system";
  • Run the following command in terminal to change server timezone:
       sudo dpkg-reconfigure tzdata

         which prompts a dialog to change time zone:


  • Now restart mysql server: /etc/init.d/mysql restart
        Run "SELECT NOW();" query in MySQL editor, which should return the   time of modified time zone .

No comments:

Post a Comment