> ## Documentation Index
> Fetch the complete documentation index at: https://docs.mora.com/llms.txt
> Use this file to discover all available pages before exploring further.

# MySQL

> Connect Mora to a MySQL database.

## Prerequisites

* A MySQL server reachable from the internet.
* A database user with read access to the schemas and tables you want to query.

## Required fields

| Field        | Description                                      | Example          |
| ------------ | ------------------------------------------------ | ---------------- |
| **Name**     | A display name for this datasource in Mora.      | `Mora warehouse` |
| **Host**     | The hostname or IP address of your MySQL server. | `localhost`      |
| **Port**     | The port MySQL is listening on.                  | `3306`           |
| **Database** | The name of the database to connect to.          | `my_database`    |
| **User**     | The database user.                               | `admin`          |
| **Password** | The user's password.                             |                  |

## Optional fields

| Field   | Description                           |
| ------- | ------------------------------------- |
| **SSL** | Enable SSL for encrypted connections. |

## Steps

1. Open **Settings → Datasources → New**.
2. Enter a name and select **MySQL** as the type.
3. Fill in the fields above.
4. Click **Test connection** to verify.
5. Click **Create**.

## Troubleshooting

* **Connection refused**: Confirm the host and port. Check that your MySQL server's `bind-address` allows remote connections.
* **Access denied**: Verify the user and password, and ensure the user has `SELECT` privileges on the target database.

## Related

* [Catalog sync](/datasources/catalog)
* [Managing datasources](/datasources/manage)
