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 回答
慕盖茨4494581
TA贡献1850条经验 获得超11个赞
serverTimezone
jdbc:mysql://localhost/db?useUnicode=true&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=UTC
qq_遁去的一_1
TA贡献1725条经验 获得超7个赞
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
提交
取消