Connect Your First Database
Learn how to connect your database to get started. Step-by-step guide for Supabase, PostgreSQL, MySQL, MongoDB, and more.
Connect Your First Database
Connecting your database is the first step to managing your data with AI. This guide will walk you through connecting different database types.
Supported Databases
We currently support the following database types:
- Supabase - Open-source Firebase alternative (recommended)
- PostgreSQL - Open-source relational database
- MySQL - Popular relational database
- MongoDB - NoSQL document database
- Notion - Connected workspace (coming soon)
- Airtable - Spreadsheet-database hybrid (coming soon)
- Google Sheets - Cloud-based spreadsheets (coming soon)
Connection Process
Step 1: Navigate to Create Workspace
- Click "Create Workspace" from your dashboard
- Select "Connect Database" option
- You'll see the database connection form
Step 2: Select Database Type
Choose your database type from the tabs at the top:
- Supabase (recommended for new projects)
- PostgreSQL
- MySQL
- MongoDB
Step 3: Enter Connection Details
The required fields vary by database type:
For Supabase and PostgreSQL
Required Fields:
- Host - Your database hostname
- Supabase:
db.xxx.supabase.cooraws-0-xx.pooler.supabase.com - PostgreSQL: Your database server hostname
- Supabase:
- Port - Database port number
- Supabase:
5432(direct) or6543(Session Pooler) - PostgreSQL: Usually
5432
- Supabase:
- Database Name - The database name
- Supabase: Usually
postgres - PostgreSQL: Your database name
- Supabase: Usually
- Username - Database user
- Supabase: Usually
postgres - PostgreSQL: Your database username
- Supabase: Usually
- Password - Database password
- SSL - Enable SSL connection (recommended)
Connection String (URI) Option:
You can also paste your connection string directly if you have it. The form will automatically fill in all the fields for you.
For MySQL
Required Fields:
- Host - MySQL server hostname
- Port - Usually
3306 - Database Name - Your MySQL database name
- Username - MySQL username
- Password - MySQL password
- SSL - Enable SSL connection (recommended)
For MongoDB
Required Fields:
- Host - MongoDB server hostname
- Port - Usually
27017 - Database Name - Your MongoDB database name
- Username - MongoDB username
- Password - MongoDB password
- SSL - Enable SSL connection (recommended)
Step 4: Test Connection
Before creating your workspace, always test the connection:
- Fill in all required fields
- Click "Test Connection"
- Wait for the test to complete (up to 15 seconds)
- If successful, you'll see "Connection Test Successful"
- If failed, check your credentials and try again
Important: You must successfully test the connection before you can create the workspace.
Step 5: Create Workspace
Once the connection test is successful:
- Click "Create Workspace"
- Your workspace will be automatically named based on your database
- You'll be redirected to the workspace setup page
Supabase Connection Guide
Finding Your Supabase Connection Details
- Open your Supabase project dashboard
- Go to Project Settings → Database
- Scroll to the Connection string section
Important: Use Session Pooler
This is very important: When connecting Supabase, use the Session Pooler or Transaction Pooler connection string, not the Direct Connection.
- Click the Connect button in Supabase
- Select the Connection String tab
- Open the Method dropdown
- Select Session Pooler (port 6543) or Transaction Pooler
- Copy the connection string or individual values
Manual Entry
If you prefer manual entry:
- Host:
db.xxx.supabase.cooraws-0-xx.pooler.supabase.com - Port:
6543(Session Pooler) or5432(Direct - not recommended) - Database:
postgres - Username:
postgres - Password: Your database password (found in Project Settings → Database)
- SSL: Enabled (recommended)
PostgreSQL Connection Guide
Connection Requirements
- Your PostgreSQL server must be publicly accessible
- Localhost connections are not supported in production
- SSL is recommended for security
Connection Details
- Host: Your PostgreSQL server hostname (e.g.,
db.mycompany.com) - Port: Usually
5432 - Database Name: Your database name
- Username: Your PostgreSQL username
- Password: Your PostgreSQL password
- SSL: Enable for secure connections
Security Best Practices
Connection Security
- ✅ Always use SSL/TLS encryption when available
- ✅ Use strong, unique passwords
- ✅ Never share your connection credentials
- ✅ Use read-only database users when possible
- ✅ Regularly rotate your database passwords
Data Privacy
- We never store your database data
- Your data stays in your database
- Connection information is encrypted and secure
Troubleshooting
Connection Test Failed
Common Issues:
- Wrong credentials - Double-check your username and password
- Host not accessible - Ensure your database is publicly accessible
- Firewall blocking - Check if your firewall allows connections
- SSL issues - Try disabling SSL if your database doesn't support it
- Wrong port - Verify you're using the correct port number
For Supabase specifically:
- Make sure you're using Session Pooler (port 6543), not Direct Connection
- Check that your password is correct in Project Settings → Database
- Verify your project is active and not paused
Connection Timeout
If the connection test times out (after 15 seconds):
- Check your network connection
- Verify the hostname is correct
- Ensure the database server is running
- Check if there are any firewall rules blocking the connection
SSL Certificate Errors
If you encounter SSL certificate errors:
- Ensure your database has a valid SSL certificate
- Try using the Session Pooler for Supabase
- For development, you may temporarily disable SSL (not recommended for production)
Next Steps
After successfully connecting your database:
- Automatic Setup - Our AI will automatically discover and organize your database
- Core Tables - Important tables will be identified and suggested
- Data Interfaces - Generate interfaces for viewing and managing your tables
- Start Querying - Start asking questions in plain English
Related Documentation
- Get Started - Overview of features
- Core Tables - Understanding core tables
- Natural Language Queries - Querying your data
