【连接异常】 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驱动包版本不一致,

mysql-connector-java.jar的版本5.1.21改为8.0.11即可

猜你喜欢

转载自www.cnblogs.com/sunny3096/p/9259169.html