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

# MySQL

> Connect Summation to a MySQL database.

Summation connects to MySQL and compatible flavors (MariaDB, RDS for MySQL, Aurora MySQL, Cloud SQL for MySQL) using standard host/port credentials.

## What you'll need

* A reachable **host** and **port** (default `3306`).
* A **database** name.
* A **user** with `SELECT` on the tables you want exposed. See [GRANT Statement](https://dev.mysql.com/doc/refman/8.0/en/grant.html) in the MySQL docs.

### Where to find host/port for your provider

| Provider                       | Where to look                                                                                                                                                                                      |
| ------------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Amazon RDS / Aurora**        | RDS console → your DB instance → **Connectivity & security**. See [Connecting to a DB instance running MySQL](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_ConnectToInstance.html). |
| **Google Cloud SQL for MySQL** | Cloud SQL console → your instance → **Connections**. See [About connection options](https://cloud.google.com/sql/docs/mysql/connect-overview).                                                     |
| **Azure Database for MySQL**   | Azure portal → your server → **Overview**. See [Connect and query](https://learn.microsoft.com/en-us/azure/mysql/flexible-server/connect-workbench).                                               |

## Form fields

| Field              | Required | Stored as | Notes                                                                                                                                                                                                                      |
| ------------------ | -------- | --------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Host**           | Yes      | Config    | DNS name or IP, e.g. `db.example.com`.                                                                                                                                                                                     |
| **Port**           | Yes      | Config    | Default `3306`.                                                                                                                                                                                                            |
| **Database**       | Yes      | Config    | The MySQL database (schema) name.                                                                                                                                                                                          |
| **Username**       | Yes      | Config    | MySQL login.                                                                                                                                                                                                               |
| **Password**       | Yes      | Secret    |                                                                                                                                                                                                                            |
| **SSL Mode**       | Optional | Config    | `disabled`, `preferred`, `required`, `verify_ca`, or `verify_identity`. Default `required`. See [`--ssl-mode`](https://dev.mysql.com/doc/refman/8.0/en/connection-options.html#option_general_ssl-mode) in the MySQL docs. |
| **CA Certificate** | Optional | Secret    | Upload or paste a PEM CA bundle for `verify_ca` / `verify_identity`. See [Configuring MySQL to use encrypted connections](https://dev.mysql.com/doc/refman/8.0/en/using-encrypted-connections.html).                       |
| **Min Pool Size**  | Optional | Config    | Minimum idle connections. Default `10`.                                                                                                                                                                                    |
| **Max Pool Size**  | Optional | Config    | Maximum concurrent connections. Default `100`.                                                                                                                                                                             |

## Setup SQL

```sql theme={null}
CREATE USER 'summation'@'%' IDENTIFIED BY '<strong-password>';
GRANT SELECT ON analytics.* TO 'summation'@'%';
FLUSH PRIVILEGES;
```

To force TLS on the user:

```sql theme={null}
ALTER USER 'summation'@'%' REQUIRE SSL;
```

See [CREATE USER Statement](https://dev.mysql.com/doc/refman/8.0/en/create-user.html) for more options.

## Adding datasets

Source references use the form:

```
mysql:my_database.my_table
```

## Common problems

| Error or symptom         | Likely cause                                                                            |
| ------------------------ | --------------------------------------------------------------------------------------- |
| `Access denied for user` | Wrong user, password, or host pattern. Check `'summation'@'%'` vs `'summation'@'10.%'`. |
| `SSL connection error`   | **SSL Mode** doesn't match the server. Most managed providers reject `disabled`.        |
| Too many connections     | Lower **Max Pool Size** if the server's `max_connections` is low.                       |
