解決java.sql.SQLException: The server time zone value '亂碼'


解決ava.sql.SQLException: The server time zone value '亂碼'

原因

1.mysql數據庫與驅動的版本不匹配
我的mysql是8.0.16版本的

所以導入的驅動包版本要正確

 <!-- mysql-->
        <dependency>
            <groupId>mysql</groupId>
            <artifactId>mysql-connector-java</artifactId>
            <version>8.0.16</version>
        </dependency>

2.時區的問題
加上&&serverTimezone=GMT

spring.datasource.url=jdbc:mysql://127.0.0.1:3306/springboot?characterEncoding=UTF-8&&serverTimezone=GMT
spring.datasource.username=root
spring.datasource.password=*****


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM