How do I set the time zone of MySQL?

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

    This is a 10 years old question, but anyway here's what worked for me. I'm using MySQL 8.0 with Hibernate 5 and SpringBoot 4.

    I've tried the above accepted answer but didn't work for me, what worked for me is this:

    db.url=jdbc:mysql://localhost:3306/testdb?useSSL=false&serverTimezone=Europe/Warsaw
    

    If this helps you don't forget to upvote it :D

提交回复
热议问题