軟件開(kāi)發(fā)倦零,為了滿足開(kāi)發(fā)的需要,jar包版本的更新或bug的修復(fù)吨悍,會(huì)造成 版本不兼容扫茅,出現(xiàn)新問(wèn)題,程序員就是為解決問(wèn)題出現(xiàn)的育瓜,一句話就是我們愛(ài)折騰葫隙,樂(lè)此不彼。
異常錯(cuò)誤:java.sql.SQLException: The server time zone value '?й???????' 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 utilize time zone support.
出現(xiàn)這種問(wèn)題還是版本更細(xì)躏仇,與其他版本造成 ? ?
顯示新版本的數(shù)據(jù)庫(kù)連接程序需要指定UTC時(shí)區(qū)恋脚,改正方法將配置文件中的“url”后面加上指定的時(shí)區(qū),將其值改為“url=jdbc:mysql://localhost:3306/db&serverTimezone=GMT”
改之前:
jdbc.driverClass? = com.mysql.cj.jdbc.Driver
jdbc.url = jdbc:mysql:///db?useUnicode=true&characterEncoding=utf8
jdbc.username = root
jdbc.password = 123456
改之后:
jdbc.driverClass? = com.mysql.cj.jdbc.Driver
jdbc.url = jdbc:mysql:///db?useUnicode=true&characterEncoding=utf8&serverTimezone=GMT
jdbc.username = root
jdbc.password = 123456