Connect LibreOffice Base to Cloud Databases

Connecting LibreOffice Base to cloud databases like Amazon RDS or Google Cloud SQL allows you to manage remote data using a familiar open-source desktop interface. This guide outlines the essential prerequisites in your cloud environment, required local drivers, and the step-by-step setup in LibreOffice Base to establish a direct connection via JDBC or ODBC.

1. Prepare the Cloud Database

Before connecting from your local machine, ensure your cloud database instance is configured to accept remote connections:

2. Configure Java and Install the Database Driver

LibreOffice Base primarily uses Java Database Connectivity (JDBC) to communicate with external SQL databases.

  1. Install a Java Runtime Environment (JRE): Ensure a 64-bit JRE (matching your LibreOffice architecture) is installed on your system.
  2. Enable Java in LibreOffice: Go to Tools > Options (or LibreOffice > Preferences on macOS) > LibreOffice > Advanced. Verify that “Use a Java runtime environment” is checked and select your installed JRE.
  3. Download the JDBC Driver: Download the appropriate .jar driver for your database engine (e.g., MySQL Connector/J or the PostgreSQL JDBC Driver).
  4. Add Driver to Class Path: In the same Advanced settings menu, click Class Path, click Add Archive, select the downloaded .jar file, and click OK. Restart LibreOffice to apply changes.

3. Connect LibreOffice Base to the Database

  1. Open LibreOffice and launch the Base Database application.
  2. In the Database Wizard, select Connect to an existing database.
  3. Select JDBC (or the specific database engine name if listed) from the dropdown menu and click Next.

4. Enter Connection Parameters

  1. Datasource URL: Enter the connection string matching your database type.
    • For MySQL: mysql://[your-rds-or-cloud-sql-endpoint]:3306/[database_name]
    • For PostgreSQL: postgresql://[your-rds-or-cloud-sql-endpoint]:5432/[database_name]
  2. JDBC Driver Class: Enter the corresponding driver class name:
    • MySQL: com.mysql.cj.jdbc.Driver
    • PostgreSQL: org.postgresql.Driver
  3. Click Test Class to ensure LibreOffice recognizes the driver properly, then click Next.

5. Set Up Authentication and Finalize

  1. Enter the database User name.
  2. Check the Password required box.
  3. Click Test Connection, enter the database password when prompted, and verify that the connection succeeds.
  4. Click Next, choose whether to register the database in LibreOffice, and click Finish.
  5. Save the .odb configuration file locally.

Once saved, LibreOffice Base will open the main dashboard, providing full access to view, edit, and query your cloud database tables.