Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

LibreOffice: 'com.mysql.jdbc.driver' cannot be loaded

Tags:

I am trying to connect LibreOffice Base with an MySQL database, in phpMyAdmin, with a JDBC-connection.

The first step is to select which database you want to select: Step 1

The second step is to select which connection: Step 2

The third step is to select your database: Step 3

When I press 'Klasse testen' ( Test Class ), I get the following error: 'com.mysql.jdbc.driver cannot be loaded'.

Does anyone know how to avoid this error?

like image 652
M Zeinstra Avatar asked Nov 24 '14 10:11

M Zeinstra


People also ask

How do I find the MySQL JDBC driver in LibreOffice?

Run LibreOffice (not Base, just LO); Open Menu Tools-> Options-> LibreOffice-> Advanced-> Class Path; Click Add Archive; Select the jar file from step 1-3 and hit OK. Now, the Class Pathdialog should look as follows: That's it. Now, LO knows where to look for the MySQL JDBC Driver.

How to connect LibreOffice Base with MySQL database in phpMyAdmin?

I am trying to connect LibreOffice Base with an MySQL database, in phpMyAdmin, with a JDBC-connection. The first step is to select which database you want to select: The second step is to select which connection: The third step is to select your database:

How to connect to JDBC instead of MySQL?

In the first screen where you chose to Connect, (rather than create or open), you can also select "JDBC" rather than "MySQL". Or in 2rd screen I can now (after I installed teh JDBC connector) "Connect directly". So there appear to be a few ways to get to JDBC. I'm not sure what the difference is, just that this is sort of complicated.

How do I set up LibreOffice to run Java?

For the Mac OS X LibreOffice, you open Preferences and navigate as shown below. For other OS's, it appears you use the Tools menu to get to the Preferences doohickeythingamajob. Once you have the JDK installed, some choices appear here. Tick the "Use a Java runtime environment" then tick the radio button in the box below.


2 Answers

You need to download and "register" the JDBC connector first. To do so:

  1. Go to http://dev.mysql.com/downloads/connector/j/ and download the ZIP archive with the JDBC connector ("Platform-Independent"); you may alternatively download the MSI installer; in this case, the jar file can be found in Program Files (x86)/MySQL/MySQL Connector J/ (assuming a Win 7 64bit system)

  2. Unzip the archive on your local PC (remember the path to its contents), or alternatively install the MSI file;

  3. In the extracted folder structure, there's a file "mysql-connector-java-5.0.8-bin.jar" (name depends on the exact version you've downloaded)

  4. Run LibreOffice (not Base, just LO);

  5. Open Menu Tools -> Options -> LibreOffice -> Advanced -> Class Path;

    enter image description here

  6. Click Add Archive;

    enter image description here

  7. Select the jar file from step 1-3 and hit OK. Now, the Class Pathdialog should look as follows:

    enter image description here

That's it. Now, LO knows where to look for the MySQL JDBC Driver.

like image 158
tohuwawohu Avatar answered Oct 09 '22 16:10

tohuwawohu


BTW, for Mariadb everything else is the same, but the jdbc driver class changes to this:

org.mariadb.jdbc.Driver 
like image 34
Elliptical view Avatar answered Oct 09 '22 16:10

Elliptical view