Home » AI Databases » MySQL Setup

How to Connect AI to Your MySQL Database

Connecting AI to your MySQL database lets you query your data with plain English, browse tables in a web UI, and edit records without writing SQL. The setup takes about five minutes: install the MySQL app, enter your connection details, and the AI automatically scans your schema so you can start asking questions immediately.

Before You Start

You need a MySQL database that accepts remote connections. This can be a managed instance on AWS RDS, DigitalOcean, PlanetScale, or any hosting provider, or a self-hosted MySQL server. You will need the host address, port number (usually 3306), database name, username, and password. Make sure the user account has the permissions you want the AI to use, typically SELECT for read-only querying, or SELECT plus INSERT, UPDATE, and DELETE if you want to edit records through the platform.

Security tip: Create a dedicated MySQL user for the AI connection with only the permissions it needs. If you only want to query data, grant SELECT access only. You can always add write permissions later. See How to Secure Your Database Connection for more detail.

Step-by-Step Setup

Step 1: Install the MySQL app.
Log into your admin panel and find the MySQL app in the app directory. Click Install to add it to your account. This creates the configuration page where you will enter your connection details.
Step 2: Enter your connection details.
Open the MySQL app settings and fill in your database host, port, database name, username, and password. If your database is on AWS RDS, use the endpoint URL that looks like mydb.abc123.us-east-1.rds.amazonaws.com. For other hosts, use the IP address or hostname provided by your hosting provider.
Step 3: Test the connection.
Click the Test Connection button. The platform attempts to connect to your MySQL server using the credentials you entered. If successful, you will see a confirmation message along with the MySQL version number. If it fails, check that your host allows remote connections and that the port is open in your firewall or security group.
Step 4: Let AI scan your schema.
Once the connection is verified, the AI reads your database schema automatically. It detects all tables, columns, data types, primary keys, foreign keys, and indexes. This schema understanding is what allows the AI to write accurate SQL queries when you ask questions in plain English. The scan happens once and updates whenever you reconnect or refresh the schema.
Step 5: Start querying with natural language.
Go to the query interface and type a question about your data. For example, "show me all orders from last week" or "how many customers signed up each month this year." The AI translates your question into SQL, runs it against your database, and displays the results. You can also browse your tables in the web UI to view and edit records visually.

Common Connection Issues

The most frequent problem is a firewall or security group blocking the connection. If your database is on AWS RDS, make sure the security group allows inbound traffic on port 3306 from the platform's IP addresses. For self-hosted databases, check that MySQL is configured to accept remote connections (the bind-address setting in your MySQL config should not be set to 127.0.0.1 only).

If the connection succeeds but the schema scan shows no tables, verify that the MySQL user has at least SELECT and SHOW TABLES privileges on the database. Some hosting providers create users with limited default permissions.

What You Can Do Next

With your MySQL database connected, you can query your data with plain English, use AI to find patterns in your data, edit records without writing SQL, or automate database reports. If you also have a PostgreSQL database, you can connect that separately using the PostgreSQL setup guide.

Connect your MySQL database to AI and start querying your data in plain English.

Get Started Free