> For the complete documentation index, see [llms.txt](https://docs.rootcause.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.rootcause.ai/data-sources-and-connectors/connectors/mysql.md).

# MySQL

Connect RootCause to a MySQL database to import tables, run custom queries, or query the database directly.

***

### Prerequisites

* Hostname or IP, port (default 3306) and database name
* A user with read access, ideally read-only
* Network access from RootCause to the database

***

### Setting up the connection

1. In the Import Manager, click the **MySQL** card
2. Enter your connection details:

| Field               | Description                       | Example          |
| ------------------- | --------------------------------- | ---------------- |
| Host                | Database server hostname or IP    | `db.example.com` |
| Port                | MySQL port                        | `3306`           |
| Database            | Database name                     | `mydatabase`     |
| Username / Password | Database user                     | `readonly_user`  |
| Enable SSL          | Encrypted connection, recommended | On               |

3. Click **Test connection** to verify, then **Save & continue**

***

### Importing data

**Tables**: browse databases and tables, tick up to 20 per import. **Custom Query**: write SQL that filters or joins before import.

***

### Import modes

Full Import, Full Import + Live, Recent Rows, Time Period and Query Directly. Rolling windows are resolved by the database. See [Connectors](/data-sources-and-connectors/connectors.md).

***

### Troubleshooting

**Access denied**

* Verify user, password and the user's host grants (a user may be restricted to specific client hosts)

**Connection timeout**

* Check host, port and firewall; confirm bind-address allows remote connections

**Unknown database**

* Check the database name's spelling and case
