Home > Debian, Java, LibreOffice, LinuxMint, MySQL, Ubuntu > Connect to MySQL database from LibreOffice Base

Connect to MySQL database from LibreOffice Base

LibreOffice’s Base program can provide a quick easy way to access a MySQL database and write some reports against data.  The following outlines how to easily setup LibreOffice Base to connect to MySQL.  It assumes that you already have LibreOffice Base installed.  It works just as easily for OpenOffice Base.First we need to install the JDBC driver for MySQL

sudo apt-get install libmysql-java

Next
  1. Open up any LibreOffice program and then click on Tools->Options.
  2. Expand LibreOffice option and then click on Java.
  3. Click on the Class Path button on the right followed by Add Archive.
  4. Browse to /usr/share/java/mysql-connector-java.jar
  5. Click Ok and choose to restart LibreOffice.
  6. Now open LibreOffice Base and choose to Connect to an existing database.
  7. In the drop-down menu choose MySQL, and connect using JDBC.
  8. Click on the Test class button to make sure the JDBC driver loads successfully.  If it doesn’t, then check that you followed the previous steps properly.  If it does load then simply enter the settings as it relates to your MySQL database.
  9. If you get the JDBC driver to load properly, but you cannot connect to your MySQL database,
  10. then I would recommend installing the mysql client and making sure you can connect from the MySQL client first.
  11. If the JDBC driver loads properly, and you can connect to your database with the MySQL database, then you should not have any problem connecting with LibreOffice.

Note : This Tutorial Article is tested on Debian family OSs.

Ref : http://maxolasersquad.blogspot.com/2011/03/connect-to-mysql-database-from.html

  1. kahn
    October 31, 2011 at 10:25 PM

    after your step 7 there should be a step 7A. when selecting the info of ‘Connection to a MySQL db using JDBC’ entering the Database name – enter it, Server – MUST BE ‘LOCALHOST’ Port number – 3306, then do your number 8 of ‘Test class’.

  2. kahn
    November 1, 2011 at 1:25 AM

    also the date accepted by LibreBase is NOT 000-00-00 format. It will NOT accept this format.

  3. February 16, 2012 at 4:53 PM
  4. nidhi
    April 20, 2012 at 1:35 AM

    Hi,
    I have read this document but, after performing steps 7 and 7A , data source is not able to establised connection and encountered an error of “failed connection to the data source” along with “access denied for user ‘root’ @’localhost’ (using password:YES)”.
    I have also installed mysql client, by using “sudo apt-get install mysql-client” command, but don’t know how to connect to mysql client.

    Thank you for help in advance!

  5. mike
    October 6, 2012 at 5:34 AM

    where do you enter the user name and password for the MySQL Database?

  6. July 18, 2013 at 3:08 AM

    Excellent way of describing, and nice post to obtain information about my presentation subject matter, which i am going to deliver in
    school.

  7. September 3, 2013 at 11:45 AM

    Good! I have an issue: on mac where I can find the right path to place the mysql connector?

  1. July 18, 2012 at 5:25 AM

Leave a comment