简体   繁体   中英

How to install com.mysql.jdbc.Driver on debian to connect to database java

I was working on a plugin that saves data inside of the database, but I got an exception:

java.lang.ClassNotFoundException: com.mysql.cj.jdbc.Driver

I know that this means that the driver is not found, but I don't know how to install it. I'm using a Debian VPS, and I was wondering how to install it. Thanks in advance!

If you use maven you can just add this to your pom.xml:

<dependency>
    <groupId>mysql</groupId>
    <artifactId>mysql-connector-java</artifactId>
    <version>8.0.23</version>
    <scope>compile</scope>
</dependency>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM