Database Connections
Estimated reading time: 15 minutes
Connecting a database gives clariBI live access to your data. This guide covers setup for each supported database type, security configuration, and sync behavior.
Before You Start
- You need the database host, port, name, and credentials
- The database must be reachable from the internet (or you need to whitelist clariBI's IP)
- A read-only user account is strongly recommended for security
PostgreSQL
The most common database connection type in clariBI.
Connection Details
| Host | Your database hostname (e.g., db.example.com) |
| Port | 5432 (default) |
| Database Name | The specific database to connect to |
| Username | Database user (preferably read-only) |
| Password | User's password |
| SSL | Enable for encrypted connections (recommended) |
Creating a Read-Only User (Recommended)
-- Connect as admin and create a read-only user
CREATE USER claribi_reader WITH PASSWORD 'your_secure_password';
GRANT CONNECT ON DATABASE your_database 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
Connection Details
| Host | Your MySQL hostname |
| Port | 3306 (default) |
| Database Name | The database to connect to |
| Username / Password | MySQL credentials |
| SSL | Enable if your server requires it |
Read-Only User
CREATE USER 'claribi_reader'@'%' IDENTIFIED BY 'your_secure_password';
GRANT SELECT ON your_database.* TO 'claribi_reader'@'%';
FLUSH PRIVILEGES;SQLite
For SQLite databases, upload the database file or provide the path to the file on a connected server.
| Database File | Path to the .sqlite or .db file |
MongoDB
| Host | MongoDB hostname (e.g., cluster.mongodb.net) |
| Port | 27017 (default) |
| Database Name | The database to connect to |
| Username / Password | MongoDB credentials |
| SSL | Enable for encrypted connections (recommended for Atlas) |
Testing Your Connection
After entering credentials, click Test Connection. clariBI will attempt to connect and verify:
- Network reachability (can it reach the host?)
- Authentication (are credentials valid?)
- Permissions (can it read tables?)
If the test fails, see Troubleshooting.
Sync Behavior
After connection, clariBI runs an initial sync to catalog tables and columns. This does not copy your full dataset. When you run an analysis or dashboard query, clariBI queries your database in real time.
For databases, clariBI uses read-only queries. It never writes to, modifies, or deletes anything in your database.
Security Best Practices
- Always use a read-only user — never connect with admin or write-capable credentials
- Enable SSL to encrypt data in transit
- Whitelist IPs if your database is behind a firewall. Contact support for clariBI's IP range.
- Rotate credentials periodically and update them in clariBI's Data Sources settings
- Limit table access — grant SELECT only on the specific tables you want to analyze
Pro Tip
If you have large tables with millions of rows, consider creating database views that pre-filter or aggregate the data you want to analyze. This makes queries faster and reduces the data volume sent through the connection.
Related
Ready to try clariBI?
Start your free 14-day trial. No credit card required.