JDBC Driver class not found: com.mysql.jdbc.Driver 解决方法
2020-05-22| 程成| 344| 0| JDBC
标签:JDBCDriver

pom.xml中直接报错了,并且提示:JDBC Driver class not found: com.mysql.jdbc.Driver


解决方法:


1、下载包,包地址:https://dev.mysql.com/downloads/connector/j/5.1.html



2、添加 mysql-connector-java-5.1.49-bin.jar 到你本地的 maven 仓库


mvn install:install-file -Dfile=/Users/chengcheng/Downloads/mysql-connector-java-5.1.49/mysql-connector-java-5.1.49-bin.jar -DgroupId=mysql -DartifactId=mysql-connector-java -Dversion=5.1.49-bin -Dpackaging=jar



2222.jpg





3、添加如下代码到你的pom.xml



<dependencies>
    <dependency>
        <groupId>mysql</groupId>
        <artifactId>mysql-connector-java</artifactId>
        <version>5.1.49-bin</version>
    </dependency>
</dependencies>



1590130879538980.png


上一篇:没有上一篇了
×
作者:程成
QQ:492245711