MySQL JDBC Driver 5.1.33 - Time Zone Issue

前端 未结 30 1199
栀梦
栀梦 2020-11-22 05:22

Some background:

I have a Java 1.6 webapp running on Tomcat 7. The database is MySQL 5.5. Previously, I was using Mysql JDBC driver 5.1.23 to connect to the DB. Ever

30条回答
  •  广开言路
    2020-11-22 05:51

    In my case, it was a test environment and I had to make an existing application to work without any configuration changes, and if possible without any MySQL config changes. I was able to fix the issue by following @vinnyjames suggestion and changing server timezone to UTC:

    ln -sf /usr/share/zoneinfo/UTC /etc/localtime
    service mysqld restart
    

    Doing that was enough for me to solve the issue.

提交回复
热议问题