How do I set the time zone of MySQL?

后端 未结 20 3281
闹比i
闹比i 2020-11-21 07:07

On one server, when I run:

mysql> select now();
+---------------------+
| now()               |
+---------------------+
| 2009-05-30 16:54:29 |
+---------         


        
20条回答
  •  迷失自我
    2020-11-21 07:42

    Ancient question with one more suggestion:

    If you've recently changed the timezone of the OS, e.g. via:

    unlink /etc/localtime
    ln -s /etc/usr/share/zoneinfo/US/Eastern /etc/localtime
    

    ... MySQL (or MariaDB) will not notice until you restart the db service:

    service mysqld restart
    

    (or)

    service mariadb restart
    

提交回复
热议问题