The following will connect OpenOffice.org Calc 2.0 to a MySQL database. This article is meant as a companion to the article by Mark Wielgus called “Connect Excel to Mysql Database”. To begin, follow Mark’s directions on downloading and configuring the ODBC driver to access your MySQL database table. We begin at Mark’s step 3:
Launch Calc. On the main menu click New->Database
This will open the Database Wizard dialog box. Select the “Connect to an existing database” option, and choose MySQL in the drop-down box. Click “Next.”
You are now at step 2 of the wizard. Choose the “Connect using ODBC (Open Database Connectivity) option and click “Next.”
Now you will choose the ODBC datasource you created earlier. Click the “Browse” button to find it, then click “Next.”
You should now be at step 4. Enter the username that has access to the database, and tick the “Password required” checkbox. You should now click the “Test connection” button to test the connectivity to the database. After clicking the button, you will be prompted for the password associated with the database username, like this:
If you cannot make a succesful connection, verify the grants for the database you are connecting to. Click “Next” and move on to step 4. At this step, uncheck “Open the database for editing” and leave the “Yes, register the database for me radio button checked.
Click the “Finish” button, and you will be prompted to save the database connection as an .odb file: OpenDocument Database. Use any name for the file, and save it. The dialog box should disappear.
Now reopen Calc, and choose View->Data Sources from the menu. This will allow you to view, manipulate, and import data from the database within the Calc application. It should look something like this: