Jdbc Driver Not Found on Ubuntu 20.04

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
0

2 Answers

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.

I think the package is now called mysql-connector-java and can be downloaded from This article might also be helpful: 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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Sarah Jenkins

Sarah Jenkins

Senior Technology Editor & AI Specialist

Sarah Jenkins is a veteran tech journalist with over 12 years of experience covering artificial intelligence, mobile innovations, and digital ethics. Her insights have appeared in leading technology publications worldwide.

Share this article
Twitter Facebook Pinterest