Connecting a PostgreSQL, MySQL, SQL Server or Oracle database
How to connect PostgreSQL, MySQL or MariaDB, SQL Server or Azure SQL, and Oracle to clariBI: the fields in the form, a read-only user, network access, choosing tables, how syncs work and what to do when the connection fails.
Which databases work
clariBI connects to four databases, on every plan within its data source limit:
| Database | Default port | Database field | Schema when left empty |
|---|---|---|---|
| PostgreSQL | 5432 | Database name | public |
| MySQL and MariaDB | 3306 | Database name | No schema field; in MySQL the database is the schema |
| SQL Server, including Azure SQL | 1433 | Database name | The login's default schema, normally dbo |
| Oracle Database | 1521 | Service name, such as ORCLPDB1 (not a SID) |
The user's own schema |
We tested the MySQL, SQL Server and Oracle connections against MariaDB 10.11, SQL Server 2022 and Oracle Database 23 Free.
SQLite is not offered: the old option could only read a file on the clariBI server. Export SQLite tables to CSV and upload them as files, or move the data into one of the four databases above. BigQuery and other stores are covered in data stores beyond the four databases.
Before you start
You need:
- Host: the server name or IP address
- Port: optional; the default for the database is used if you leave it empty
- Database name, or the service name for Oracle
- Username and password for a user with read access
- Network access: the database must accept connections from the internet, because clariBI connects from its own servers. clariBI refuses private, local and internal addresses such as
10.x,192.168.xand127.0.0.1, so a database that only listens on a private network orlocalhostcannot be reached.
Create a read-only user
clariBI only reads. Table syncs are plain SELECT statements, and any query clariBI runs against your database must be a single read-only SELECT (or WITH ... SELECT) statement; anything else is refused before it reaches the database. Still, give clariBI a user that can do nothing but read.
PostgreSQL:
CREATE USER claribi_reader WITH PASSWORD 'a-long-random-password';
GRANT CONNECT ON DATABASE analytics TO claribi_reader;
GRANT USAGE ON SCHEMA public TO claribi_reader;
GRANT SELECT ON ALL TABLES IN SCHEMA public TO claribi_reader;
ALTER DEFAULT PRIVILEGES IN SCHEMA public
GRANT SELECT ON TABLES TO claribi_reader;
MySQL and MariaDB:
CREATE USER 'claribi_reader'@'%' IDENTIFIED BY 'a-long-random-password';
GRANT SELECT ON analytics.* TO 'claribi_reader'@'%';
SQL Server (on Azure SQL, run CREATE LOGIN in the master database and the rest in your database, without USE):
CREATE LOGIN claribi_reader WITH PASSWORD = 'a-long-random-password';
USE analytics;
CREATE USER claribi_reader FOR LOGIN claribi_reader;
ALTER ROLE db_datareader ADD MEMBER claribi_reader;
Oracle:
CREATE USER claribi_reader IDENTIFIED BY "a-long-random-password";
GRANT CREATE SESSION TO claribi_reader;
GRANT SELECT ON app_owner.orders TO claribi_reader;
Replace analytics, public and app_owner with your own database, schema and table owner.
Connect
- Click Data Sources in the sidebar (this opens Settings > Integrations) and click Add Data Source.
- Choose the Databases category, then PostgreSQL, MySQL, SQL Server or Oracle.
- Fill in the form:
| Field | Example |
|---|---|
| Data Source Name | Production analytics |
| Host | db.example.com |
| Port (optional) | 5432 |
| Database name (Service name on Oracle) | analytics (Oracle: ORCLPDB1) |
| Username | claribi_reader |
| Password | (your password) |
| Schema (optional; Schema owner on Oracle; not shown for MySQL) | public |
| Tables to sync (optional) | orders, customers, invoices |
- Click Test Connection, then Create Data Source.
If you leave Tables to sync empty, clariBI reads every table it can see in the schema. Listing the tables you need keeps syncs smaller and faster.
The password is encrypted before it is stored.
There is no SSL or encryption setting in the form. For SQL Server, the login is always encrypted, and the whole session is encrypted when the server forces encryption, as Azure SQL does.
What gets synced
clariBI tests the connection and syncs right away. Each table becomes a dataset in the source, and clariBI builds the automatic dashboard for the source, as it does for every source. Once the first sync finishes you can ask questions about the data.
Each sync copies at most 1,000 rows per table for each data source your plan allows:
| Plan | Data sources | Rows per table per sync |
|---|---|---|
| Free and Trial | 3 | 3,000 |
| Lite | 5 | 5,000 |
| Starter | 10 | 10,000 |
| Professional | 50 | 50,000 |
| Enterprise | 100 | 100,000 |
For bigger tables, point clariBI at a view that aggregates the data, for example daily totals instead of individual orders.
Keeping data current
There is no incremental sync: each sync reads the tables again. clariBI syncs the database when its data is more than a day old and a question, report or dashboard refresh uses it. To sync right away, click Sync now on the source's dashboard, or open the source in Settings > Integrations and click Sync Data. The same panel has Test Connection, a data overview (rows, columns, date range) and Edit Setup, where you can change the host, credentials and other settings without deleting the source.
Hosted databases
- Amazon RDS: use the instance endpoint (for example
mydb.abc123.us-east-1.rds.amazonaws.com) as the host, make the instance publicly accessible, and allow inbound connections on the database port in the instance's security group. - Google Cloud SQL: enable the public IP and add an authorized network that allows the connection.
- Azure SQL: use the server name ending in
database.windows.netas the host, and allow the connection in the server's firewall rules. - Supabase and Neon: use the direct connection host, port, database name and user from the provider's dashboard. Both are also available as MCP apps in the Apps category, which may suit you better.
We do not publish a fixed list of outgoing IP addresses. If your firewall needs one, contact support before you rely on it.
The database connections page in the documentation summarizes the same setup, and the blog has a longer PostgreSQL walkthrough.
Performance tips
- Point clariBI at a read replica if the primary database is busy.
- Use views to join and pre-aggregate data.
- Index the columns your views filter and group on, such as dates.
Troubleshooting
Connection refused or timeout. The server is not reachable on that host and port. Check the host name, the port, and that the firewall or security group allows outside connections. A connection attempt gives up after 15 seconds.
Host refused as private or internal. The host is, or resolves to, a private, local or internal address. Use a public host name or address.
Authentication failed. The username or password is wrong, or the user may not connect from outside. On PostgreSQL, check pg_hba.conf and the GRANT CONNECT above. On MySQL, the user's host part must allow remote connections ('claribi_reader'@'%'). On SQL Server, the server must accept SQL Server logins. On Oracle, check the service name and the CREATE SESSION grant.
No syncable tables. The user cannot see any tables in the schema, or the names in Tables to sync do not exist. Check the schema name and the GRANT SELECT statements.
For other messages, see data source errors and how to fix them.