Most Popular Pages....


My Clients....

litigious bastards

- Whats this?

Accessing a MYSQL Database with OpenOffice

It took me a little time to work this out so I thought I had better write it down for future reference.

Open Office is able to make a connection to various types of database, including MySQL. The procedure for doing it is not obvious. I learned how from this document. Here I add a little more detail to help Mandrake users to get running with MySQL.

Requirements

I was using OpenOffice- 1.3

You will also need a working MySQL database. In my case I was trying to connect to the database from my MythTV application. If you have not yet set up a database install MySQL and MySQL-client and read this guide to setting up MySQL .

You will also need to install mysql-connector-java which is a Java JDBC application to connect to MySQL with Java. This package is available from here.

Download the .tar.gz file and click on the downloaded file with konqueror to uncompress it. Open a root copy of konqueror with Alt+F2 and enter 'kdesu konqueror' in the box. (assuming you are running KDE) Drag and drop the uncompressed mysql-connector-java-3.1.7 folder into /opt. (Only root user can write to /opt)

Procedure

Now open OpenOffice>Tools>Options>OpenOffice.Org>Security and in the box where it says 'ClassPath' press 'Browse' and select the file mysql-connector-java-3.1.7-bin.jar from the folder you just dropped into /opt

Now select Tools>DataSources press 'New Data Source' pick a name for this source, and select MySQL as the database type, then go to the MySQL tab to configure the connector.

Configure the connector with the hostname and database name you want to connect to using the 'J3' connector. You must give a valid user name and password for this database.

Click on the image to see it larger

Now in Open Office select View>DataSources to see your remote connections. Click on 'Tables' to see the remote database contents. You are now ready to work with MySQL databases.

Tuesday 8th March 2005

Top Home