MySQL JDBC Driver 5.1.33 - Time Zone Issue

前端 未结 30 1722
栀梦
栀梦 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:55

    I'm using mysql-connector-java-8.0.13 and had the same problem. I created my database in the command line console and solved this problem by using @Dimitry Rud's solution on the command line:

    SET GLOBAL time_zone = '-6:00';
    

    I didn't need to restart anything, set the time and immediately run my code in eclipse, it connected with no problems.

    The bug is supposed to be fixed in an older version, but I think I got this error because after I created the database in the console, I didn't set this. I'm not using workbench nor another app to manage this rather than the console.

提交回复
热议问题