I have installed MySQL 5.5.32 via apt-get install
into Ubuntu 13.04.I want to use it in a Java project.For this i must have MySql connector jar.I can not find it.I tried locate *mysql*.jar
but it did not find anything.I looked into /etc/mysql
but there is no jar in it.I don't want to download it from internet because i believe that it somehow exists in an MySQL folder.Does anybody have any idea where the connector jar went into Ubuntu 13.04?

- 23,270
- 2
- 52
- 65

- 1,541
- 1
- 17
- 26
3 Answers
If you're using a version of Ubuntu prior to 19.04, you'll need to install libmysql-java, the MySQL JDBC driver, because the connector is not in the Ubuntu-packaged MySQL package that you've already installed. Versions after that do not publish that package.
Once it's installed, you'll have the file /usr/share/java/mysql.jar
, which is an indirect symlink to the actual jar file.
Alternatively, install the mysql-apt-config package, update, and you'll be able to install all currently supported MySQL software with apt
.

- 23,270
- 2
- 52
- 65
-
2ubuntu 19.10: E: Unable to locate package libmysql-java – eddy147 Apr 07 '20 at 07:13
-
It seems Ubuntu only ships this package with 16.04 and 18.04 LTS at this time. – Jeremy Smyth Apr 08 '20 at 08:28
-
while the path is correct, even now, the file name may be different ex: /usr/share/java/mysql-connector-java-8.0.23.jar – sandeepkunkunuru Feb 10 '21 at 11:27
First, apt-get install libmysql-java
Then mysql.jar
is located in /usr/share/java/mysql.jar
.
Third, in Eclipse, do this as: Project -> Properties -> Java Build Path -> Libraries -> Add External JARs -> select /usr/share/java/mysql.jar

- 9,678
- 13
- 71
- 102

- 856
- 8
- 8
-
3Project > Properties > Java Build Path > Libraries (tab) > Add External Jars, just to spell it out completely – Greg Nisbet Sep 14 '15 at 20:49
In ubuntu 19.10 the following works:
apt-get install libmariadb-java

- 139
- 1
- 2
-
4for ubuntu 20 too ? how can i check if my ubuntu have already mysql-connector-java ? – ZINE Mahmoud Jan 08 '21 at 15:22
-
1