eclipse 报错java.lang.ClassNotFoundException: com.mysql.jdbc.Driver错误解决

Winema ·
更新时间:2024-11-13
· 964 次阅读

一:查看你下载的MySQL和mysql-connector-java,如果不对应的话肯定会报错。
对应规则:
mysql-connector-java-5

Connector/J version Driver Type JDBC version MySQL Server version Status
5.1 4 3.0, 4.0, 4.1, 4.2 4.1, 5.0, 5.1, 5.5, 5.6, 5.7 Recommended version
5.0 4 3.0 4.1, 5.0 Released version
3.1 4 3.0 4.1, 5.0 Obsolete
3.0 4 3.0 3.x, 4.1 Obsolete

官方:mysql-connector-java-5
mysql-connector-java-6

Connector/J version JDBC version MySQL Server version JRE Supported JDK Required for Compilation Status
6.0 4.2 5.5, 5.6, 5.7 1.8.x 1.8.x Developer Mileston
5.1 3.0, 4.0, 4.1, 4.2 4.1, 5.0, 5.1, 5.5, 5.6*, 5.7* 1.5.x, 1.6.x, 1.7.x, 1.8.x* 1.5.x ,1.8.x Recommended version

官方:mysql-connector-java-6

二:配置问题
mysql-connector-java 5:com.mysql.jdbc.Driver
mysql-connector-java 6: com.mysql.cj.jdbc.Driver
用反会出错


作者:Available time



java.lang com lang JAVA Eclipse jdbc Mysql

需要 登录 后方可回复, 如果你还没有账号请 注册新账号