MySQL JDBC驅動程序5.1.33-時區問題一些背景:我在Tomcat 7上運行了一個Java1.6webapp,數據庫是MySQL5.5。以前,我使用MySQLJDBC驅動程序5.1.23連接到DB。一切正常。我最近升級到MySQLJDBC驅動程序5.1.33。升級之后,Tomcat會在啟動應用程序時拋出這個錯誤。WARNING: Unexpected exception resolving reference
java.sql.SQLException: The server timezone value 'UTC' is unrecognized or represents more than one timezone. You must configure either the server or JDBC driver (via the serverTimezone configuration property) to use a more specifc timezone value if you want to utilize timezone support.為什么會發生這種事?
3 回答

慕姐8265434
TA貢獻1813條經驗 獲得超2個贊
serverTimezone
jdbc:mysql://localhost/db?useUnicode=true&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=UTC

慕娘9325324
TA貢獻1783條經驗 獲得超4個贊
pom.xml
:
<dependency> <groupId>mysql</groupId> <artifactId>mysql-connector-java</artifactId> <version>5.1.39</version></dependency>
<dependency> <groupId>mysql</groupId> <artifactId>mysql-connector-java</artifactId> <version>6.0.3</version></dependency>
pom.xml
添加回答
舉報
0/150
提交
取消