How to connect MySQL to an AI data analyst
Updated 2026-07-01
An AI data analyst is most useful when it runs on your real data. This guide shows how to connect MySQL so you can ask questions in plain English and get charts, dashboards and reports back — without writing SQL by hand.
The setup takes a few minutes: connect with a read-only user, let the analyst read the schema, and ask your first question. Your credentials are encrypted, and the analysis runs on your own AI provider key.
- 1
Get your MySQL connection details
You need the host, port (usually 3306), database name, username and password. On managed MySQL, copy these from the instance dashboard and note whether SSL is required.
- 2
Create a read-only user (recommended)
Create a dedicated read-only user: GRANT SELECT on the database to a new user. The analyst then can read to answer questions but can never modify data.
- 3
Create your account and add your AI key
Sign up, then add your own AI provider key (bring-your-own-key). If you don't have one yet, a free key takes about a minute to create — your key is encrypted and used only for your requests.
- 4
Add the MySQL connection
Add a data source, choose MySQL, and enter host, port, database, user and password. Enable SSL if your provider requires it, then test and save — credentials are encrypted at rest.
- 5
Let the AI read and annotate your schema
Let the analyst read and annotate your tables and columns. If you model with dbt, point it at your dbt schema so it recognises your fact and dimension tables.
- 6
Ask your first question in plain English
Ask something like "Revenue by month for this year". On complex questions the analyst shows a readable query plan before it runs anything; review it, then get a chart plus the data behind it. Refine by chatting, then pin it to a dashboard or save it as a report.
Why connect MySQL instead of exporting
A static export goes stale the moment you download it, and a general AI assistant that only sees a pasted file guesses what your columns mean. A connected AI data analyst reads live MySQL data, shows the query plan before running it, and remembers what your fields mean between sessions — so answers stay current and consistent.
MySQL: things to know
- If the connection times out, check that your MySQL host allows connections from the app and that any firewall/allowlist includes it.
- Very large tables answer faster if you ask for a time range rather than "all time".
Example questions to ask your MySQL data
- Revenue by month for this year
- Top 10 products by units sold last quarter
- New vs returning customers by week
Keeping it safe
- Connect with a read-only user so the analyst can never change your data.
- A read-only SQL guard blocks anything that isn't a read query.
- Connection details and your AI key are encrypted at rest.
- Your business data isn't stored or used to train any model.
Frequently asked questions
Related
Get your end-to-end AI business intelligence now.
Conversational analytics with AI that understands your data — no SQL, no data team required.