慕婉清6462132
2019-07-26 15:14:10
MySQL JDBC驅(qū)動(dòng)程序5.1.33-時(shí)區(qū)問(wèn)題一些背景:我在Tomcat 7上運(yùn)行了一個(gè)Java1.6webapp,數(shù)據(jù)庫(kù)是MySQL5.5。以前,我使用MySQLJDBC驅(qū)動(dòng)程序5.1.23連接到DB。一切正常。我最近升級(jí)到MySQLJDBC驅(qū)動(dòng)程序5.1.33。升級(jí)之后,Tomcat會(huì)在啟動(dòng)應(yīng)用程序時(shí)拋出這個(gè)錯(cuò)誤。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.為什么會(huì)發(fā)生這種事?
3 回答

慕蓋茨4494581
TA貢獻(xiàn)1850條經(jīng)驗(yàn) 獲得超11個(gè)贊
serverTimezone
jdbc:mysql://localhost/db?useUnicode=true&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=UTC

函數(shù)式編程
TA貢獻(xiàn)1807條經(jīng)驗(yàn) 獲得超9個(gè)贊
SET GLOBAL time_zone = '+3:00';

qq_遁去的一_1
TA貢獻(xiàn)1725條經(jīng)驗(yàn) 獲得超8個(gè)贊
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
添加回答
舉報(bào)
0/150
提交
取消