How do I set the time zone of MySQL?

后端 未结 20 3295
闹比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:36

    You have to set up the your location timezone. So that follow below process
    Open your MSQLWorkbench write a simple sql command like this;

    select now();
    

    And also your url could be like this;

    url = "jdbc:mysql://localhost:3306/your_database_name?serverTimezone=UTC";
    

提交回复
热议问题