How to set correct MySQL JDBC timezone in Spring Boot configuration

前端 未结 11 1160
佛祖请我去吃肉
佛祖请我去吃肉 2020-12-14 01:28

DB:

$ mysql --version
mysql  Ver 14.14 Distrib 5.6.27, for osx10.10 (x86_64) using  EditLine wrapper

Spring Boot: 2.1.1.RELEASE

The

11条回答
  •  囚心锁ツ
    2020-12-14 02:11

    This worked for me. I set the variable in the db URL as such in application.properties:

    spring.datasource.url=jdbc:mysql://localhost:3306/db_name?serverTimezone=America/Los_Angeles
    

提交回复
热议问题