MySQL JDBC Driver 5.1.33 - Time Zone Issue

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

    I am late, But If you are struggling through the following error and using datasource(javax.sql.DataSource):

    The server time zone value 'CEST' is unrecognized or represents more than one time zone.
    

    Set following line to get rid of the error:

    MysqlDataSource dataSource = new MysqlDataSource();
    dataSource.setServerTimezone("UTC");
    

提交回复
热议问题