1. 程式人生 > >java.lang.ClassCastException: java.math.BigInteger cannot be cast to java.lang.Long

java.lang.ClassCastException: java.math.BigInteger cannot be cast to java.lang.Long

MySQL更新到8.0.11之後連線資料庫時會報出錯誤

Your login attempt was not successful, try again.
Reason: Could not get JDBC Connection; nested exception is java.sql.SQLException: java.lang.ClassCastException: java.math.BigInteger cannot be cast to java.lang.Long

解決方法:將mysql連線的版本改為8.0.11即可

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