The server time zone value '?й???????' is unrecognized or represents more than one time zone. You...

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 問題

錯誤原因:

????本人用最新版本的mysql數據庫

????使用原mysql5.1.38不會出現該問題,但會提示版本驅動過舊的情況

????使用了Mysql最新版驅動所以報錯

????新版驅動名字為 driverClass=“com.mysql.cj.jdbc.Driver”

????解決方案:

????方案1、在項目代碼-數據庫連接URL后,加上 ?serverTimezone=UTC(注意大小寫必須一致)


方案2、在mysql中設置時區,默認為SYSTEM(推薦)

set global time_zone=’+8:00’

mysql> set global time_zone='+8:00';

Query OK, 0 rows affected (0.01 sec)

?著作權歸作者所有,轉載或內容合作請聯系作者
平臺聲明:文章內容(如有圖片或視頻亦包括在內)由作者上傳并發布,文章內容僅代表作者本人觀點,簡書系信息發布平臺,僅提供信息存儲服務。

推薦閱讀更多精彩內容