JDBC driver not found on Ubuntu 20.04

10,010

Solution 1

Had found this 'answer', then did some more digging about and found a post on Reddit saying this package was merged in to libmariabd-java:

I found the solution. The libmysql-java has been (I think merged) with libmariadb-java. So, I just installed it using

sudo apt install libmariadb-java

After that just repeated the same steps as I would do with 18.04 and it worked! No problems whatsoever.

Solution 2

I think the package is now called mysql-connector-java and can be downloaded from mysql.com/products/connector. This article might also be helpful: https://www.vogella.com/tutorials/MySQLJava/article.html Edited to add this suggestion: If you add the mysql repos to ubuntu or debian (howto on mysql website) then the command: sudo apt install mysql-connector-java pulls the file from those repos.

Share:
10,010

Related videos on Youtube

Mike M
Author by

Mike M

Updated on September 18, 2022

Comments

  • Mike M
    Mike M almost 2 years

    I recently updated the Ubuntu OS and now I cannot get the Java programs to connect to the MySQL database. The following error occurs:

    java.sql.SQLException: No suitable driver found for jdbc:mysql://localhost:3306/PTAX?useSSL=false
    

    I searched the web and the only thing I found was to install libmysql-java. However, when I try to install it, the message below occurs.

    Unable to locate package libmysql-java