這是由於mysql驅動包跟新的緣故,不能再使用以前舊的mysql驅動包。
根據提示,更改相應的驅動包就可以了。
這個驅動更新還可能會引發一個錯誤:
java.sql.SQLNonTransientConnectionException: Cannot load connection class because of underlying exception: com.mysql.cj.exceptions.WrongArgumentException: Malformed database URL, failed to parse the connection string near ';characterEncoding=utf-8'
解決辦法:
之前:jdbc:mysql://localhost:3306/tree?useUnicode=true&characterEncoding=utf-8
現在:jdbc:mysql://localhost:3306/tree?useUnicode=true&characterEncoding=utf-8&useSSL=false&serverTimezone = GMT
將之前的鏈接改成現在的鏈接後,就不會出現這個問題。