How to connect LibreOffice Base to MySQL using JDBC on Mac OS X

In this article I’ll explain how to connect LibreOffice Base to MySQL database on Mac OS X. This guide should be useful for Windows as well, as there shouldn’t be too many differences.

First, you’ll need to download MySQL Connector/J, which is the official MySQL JDBC driver. Go to official download page to get it. Select Platform Independent option and download either zip or tar.gz file.

Once file is downloaded, extract it to a location in your home directory, e.g. $Home/Development/MySQLJDBC.

Now we’ll need to set up LibreOffice to use the driver. Open LibreOffice and go to Preferences. Then go to LibreOffice -> Advanced and click on Class Path. Click on Add Archive and browse to the jar file that is in the extracted directory you’ve created previously.

After adding new class path, restart LibreOffice.

Now create new Base database and select “Connect to an existing database”. Choose JDBC from the list.
In the next step, enter Datasource URL and JDBC driver class.

Datasource URL is in the format mysql://servername:port/databasename. If you are running MySQL on the default port (3306), you don’t have to specify it.

For JDBC driver class, enter com.mysql.jdbc.Driver. If you click on Test class button, message saying “The JDBC driver was loaded successfully” should appear.

Click on next. Specify user name, select Password required if selected user name requires password. You can test the connection by clicking on Test connection.

Click on Finish to save the Base file. When you open the Base file you’ve just created, it will be connected to the MySQL database and you will have access to all MySQL database tables.

Advertisements

7 thoughts on “How to connect LibreOffice Base to MySQL using JDBC on Mac OS X

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s