1. 程式人生 > 資料庫 >SQLException: The server time zone value ‘EDT‘ is unrecognized or represents more than one time zone

SQLException: The server time zone value ‘EDT‘ is unrecognized or represents more than one time zone

異常:java.sql.SQLException: The server time zone value 'EDT' 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.
 

伺服器的時區值"EDT"無法識別,或表示多個時區,這種錯誤表示新版本的資料庫連線程式需要指定UTC時區,只要再url後面加上指定的時區即可

通常mysql返回的時間比實際時間總是早8小時,MySQL文件中,可用的時區都在/usr/share/zoneinfo目錄下面,一般配置URL時,可以嘗試GMT,GMT8,UTC+8,UTC0800等...

jdbc配置異常:

 

改正之後: