添加mysql依賴異常

在spring+mybatis項目中,在pom.xml添加一下依賴後

<!-- https://mvnrepository.com/artifact/mysql/mysql-connector-java -->

<dependency>

<groupId>mysql</groupId>

<artifactId>mysql-connector-java</artifactId>

<version>8.0.11</version>

</dependency>

 

出現如下錯誤:

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.

 

這是系統時間錯誤。這是在使用MySQL 8.0以上版本(MySQL連接驅動和版本都是8.0以上)的時候出現的問題錯誤,我們需要在訪問數據庫的Url後面加上以下的語句即可:

jdbc:mysql://localhost:3306/yd?serverTimezone=GMT%2B8

 

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章