MySQL JDBC Driver 5.1.33 - Time Zone Issue

前端 未结 30 1853
栀梦
栀梦 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 06:08

    i Got error similar to yours but my The server time zone value is 'Afr. centrale Ouest' so i did these steps :

    MyError (on IntelliJ IDEA Community Edition):

        InvalidConnectionAttributeException: The server time zone value 'Afr. centrale Ouest' is unrecognized or represents more than one time zone. You must configure either the server or JDBC driver (via the 'serverTimezone' configuration property) to use a more specifc time zone value if you want to u....
    

    I faced this issue when I upgraded my mysql server to SQL Server 8.0 (MYSQL80).

    The simplest solution to this problem is just write the below command in your MYSQL Workbench -

      SET GLOBAL time_zone = '+1:00'
    

    The value after the time-zone will be equal to GMT+/- Difference in your timezone. The above example is for North Africa(GMT+1:00) / or for India(GMT+5:30). It will solve the issue.

    Enter the Following code in your Mysql Workbench and execute quesry

    [source link for question/problem ]

    [source link for answer]

    [Solution ScreenShot ]

提交回复
热议问题