Home » AI Data Analysis » Connect Database

How to Connect AI to Your Existing Business Database

To connect AI to your existing database, open the MySQL or PostgreSQL app, enter your database host, port, credentials, and database name. The AI connects, reads your table structure, and is ready to answer questions about your live data within seconds. Your data stays in your database and is never copied or stored elsewhere.

What You Need

To connect your database, you need four pieces of information from your database administrator or hosting provider:

For security, create a read-only database user specifically for AI analysis. This prevents any possibility of accidental data modification. Most database hosting providers like AWS RDS, DigitalOcean, and PlanetScale make it easy to create read-only users through their admin panels.

Step-by-Step Connection

Step 1: Choose your database type.
Open the MySQL app if your database is MySQL or MariaDB. Open the PostgreSQL app if your database is PostgreSQL. If you are not sure which type you have, check your hosting provider's documentation or ask your developer.
Step 2: Enter your connection details.
Fill in the host, port, database name, username, and password. The connection uses SSL encryption by default. Your credentials are stored securely in your account and are never shared with the AI model itself; the platform uses them to establish the database connection on the server side.
Step 3: Test the connection.
The system attempts to connect and read your database schema. If successful, you see a list of your tables and can begin querying immediately. If the connection fails, common causes include: the database host not allowing external connections, a firewall blocking the port, or incorrect credentials.
Step 4: Start querying.
Once connected, ask questions about your data in plain English: "What tables do I have?" "Show me the first 10 rows of the customers table" "How many orders were placed this month?" The AI translates your questions into SQL, runs them, and returns results.

Common Connection Issues and Fixes

Database Not Allowing External Connections

Many databases are configured to only accept connections from specific IP addresses. You may need to add the platform's IP address to your database's allow list. Check your hosting provider's documentation for how to whitelist external IPs. For AWS RDS, this is done through security groups.

Firewall Blocking the Port

If your database runs on a server with a firewall, ensure that port 3306 (MySQL) or 5432 (PostgreSQL) is open for inbound connections from the platform. Cloud providers like AWS, Google Cloud, and Azure all have firewall rules that need to be configured to allow external database access.

SSL Requirements

Some database servers require SSL connections. The platform supports SSL connections by default. If your server requires a specific SSL certificate, you may need to configure this in your database app settings.

What Happens After Connection

Once connected, the AI automatically reads your database schema and builds an understanding of your data structure. It knows which tables exist, what columns they contain, what data types are used, and how tables relate to each other through foreign keys. This schema understanding enables the AI to translate your plain English questions into accurate SQL queries.

Your data stays in your database at all times. The AI sends SQL queries to your database, receives results, and then interprets them for you. No data is copied, cached, or stored outside your database. Each query runs against your live data, so results are always current.

For ongoing analysis, the connection persists in your account settings so you do not need to re-enter credentials each time. You can disconnect at any time by removing the connection details.

Performance tip: For databases with many tables (100+), the initial schema reading may take a few seconds longer. You can speed this up by specifying which tables are relevant: "I only need to work with the customers, orders, and products tables." The AI focuses on those tables and ignores the rest.

Connect your database to AI and start querying with plain English. No SQL required.

Get Started Free