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:
- Network Access: In Amazon RDS (Security Groups) or Google Cloud SQL (Authorized Networks), add your local public IP address to the firewall whitelist.
- Public Accessibility: Ensure the instance is set to be publicly accessible or configured with a secure tunnel/VPN.
- Database Credentials: Note your connection endpoint (hostname), port number (e.g., 3306 for MySQL, 5432 for PostgreSQL), database name, username, and password.
- SSL/TLS: Download the required SSL/TLS root certificates from AWS or Google Cloud if your database enforces encrypted connections.
2. Configure Java and Install the Database Driver
LibreOffice Base primarily uses Java Database Connectivity (JDBC) to communicate with external SQL databases.
- Install a Java Runtime Environment (JRE): Ensure a 64-bit JRE (matching your LibreOffice architecture) is installed on your system.
- 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.
- Download the JDBC Driver: Download the appropriate
.jardriver for your database engine (e.g., MySQL Connector/J or the PostgreSQL JDBC Driver). - Add Driver to Class Path: In the same
Advanced settings menu, click Class
Path, click Add Archive, select the downloaded
.jarfile, and click OK. Restart LibreOffice to apply changes.
3. Connect LibreOffice Base to the Database
- Open LibreOffice and launch the Base Database application.
- In the Database Wizard, select Connect to an existing database.
- Select JDBC (or the specific database engine name if listed) from the dropdown menu and click Next.
4. Enter Connection Parameters
- 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]
- For MySQL:
- JDBC Driver Class: Enter the corresponding driver
class name:
- MySQL:
com.mysql.cj.jdbc.Driver - PostgreSQL:
org.postgresql.Driver
- MySQL:
- Click Test Class to ensure LibreOffice recognizes the driver properly, then click Next.
5. Set Up Authentication and Finalize
- Enter the database User name.
- Check the Password required box.
- Click Test Connection, enter the database password when prompted, and verify that the connection succeeds.
- Click Next, choose whether to register the database in LibreOffice, and click Finish.
- Save the
.odbconfiguration file locally.
Once saved, LibreOffice Base will open the main dashboard, providing full access to view, edit, and query your cloud database tables.