Database
MySQL Connector
Index the tables of a MySQL database: one document per table, rows rendered as readable text rather than a schema dump.
Prerequisites
- A MySQL database you can read, version 5.7 or later
- A user with `SELECT` on the tables to index
- The database name, and its host and port if it is not local
Data ingested
When you connect MySQL, the following content becomes searchable. Every answer that uses it cites it.
| Content | What is kept |
|---|---|
| Tables | Every table and view of the selected database, listed from `information_schema` |
| Rows | Up to 500 rows per table, each row rendered as `column = value` pairs |
| Dates | A `DATE` column stays a date: no invented time is appended |
Setup
Configuration happens in the dashboard, under Integrations. No API call is needed for a normal setup.
Create a read-only user
`CREATE USER 'qm_reader'@'%' IDENTIFIED BY '...'; GRANT SELECT ON mydb.* TO 'qm_reader'@'%';` Read-only is enough: the session is set to `READ ONLY` and the connector never writes.
Enter the connection
Integrations → Add source → MySQL: host, port (3306 by default), database and user. Or paste a `mysql://` URL in the **URL** field.
Set the secret
The user password, in the **Secret** field.
Connect and sync
**Test** lists the tables without indexing; **Sync** reads the rows and indexes them.
Configuration options
| Field | Description | Required |
|---|---|---|
| URL or DSN | Full `mysql://user:password@host:port/database`. Takes precedence over the separate fields | No |
| Host | Database host. Defaults to `127.0.0.1` | No |
| Port | Database port. Defaults to `3306` | No |
| Database | Name of the database to index | Yes |
| User | User used to connect | Yes |
| Secret | Password of that user | No |
| Schema | Restrict indexing to one schema. Empty means the database itself | No |
Best practices
- •Only the selected database is read: `information_schema` is filtered on it, so a server hosting several applications does not leak the others into the corpus.
- •A `BLOB` or binary column is rendered as its text form and carries no knowledge: exclude those tables rather than paying for their embeddings.
- •MariaDB speaks the same protocol and is declared as its own type: pick **MariaDB** in the form so the source is labelled correctly, even though the same code serves both.
Troubleshooting
The password is in the **Secret** field, and the user must be allowed from the host the server sees, not only from `localhost`.
The **Database** field is empty. MySQL has no default database to fall back on.
The user lacks `SELECT` on it, or it belongs to another database on the same server.
The server listens on `127.0.0.1` only, or the firewall blocks the port. Check `bind-address` on the server side.
Next steps
Once the source is connected and indexed, ask a question from the chat and check that the answer cites this source. A source that never appears in a citation is usually a source with nothing indexed: see Troubleshooting above.
