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

# MySQL streaming connector

export const s_runner = "Streaming runner";

export const maia = "Maia";

The MySQL connector can monitor and capture row-level changes within MySQL schemas in a non-intrusive and performant manner. The connector produces a change event record for every insert, update, and delete event occurring in any tables being monitored by the {s_runner}.

<Note>
  We are using the **Debezium MySQL** connector to connect to this source. For more information, read [Debezium connector for MySQL](https://debezium.io/documentation/reference/stable/connectors/mysql.html).
</Note>

***

## Prerequisites

{maia} supports the following MySQL configurations:

* Database versions `8.0` and above. Check your MySQL version with `mysql -V`.
* Database driver version `8.0.29`

***

## Source setup

Refer to this section when you [create a streaming pipeline](/docs/streaming/streaming-pipelines/#source-setup).

<ResponseField name="Server address" type="string" required>
  The server address of your MySQL database.
</ResponseField>

<ResponseField name="Port" type="integer" required>
  The port number used to access your MySQL database. The default is `3306`.
</ResponseField>

<ResponseField name="Database name" type="string" required>
  The name of your MySQL database.
</ResponseField>

<ResponseField name="Read Replica" type="boolean" required>
  Set to true ✅ if the source database is an always-on, read-only replica database.
</ResponseField>

<ResponseField name="Username" type="string" required>
  The username used to log in to the specified database.
</ResponseField>

<ResponseField name="Secrets Manager" type="drop-down" required>
  Choose the service you use to manage secrets.

  * [AWS Secrets Manager](/docs/administration/aws-secrets-manager)
  * [Azure Key Vault](/docs/administration/azure-key-vault)
</ResponseField>

<ResponseField name="Secret name" type="string" required>
  The name of the secret in your secret manager service that references your MySQL password.
</ResponseField>

<ResponseField name="JDBC parameters and specific connection settings" type="column editor">
  Specify any parameter:value pairs as part of an advanced connection. Click **Save** to finish adding parameters.

  Click **Connect** to establish the connection to your source database.
</ResponseField>

## Configure new tables

When adding tables to a pipeline, they must be correctly configured to allow the on-demand snapshot to take place and to ensure change data capture will stream future changes on those tables. Read [Configure your MySQL database](/docs/streaming/mysql-configure-database/) for a more comprehensive outline of these requirements.

### Grant permissions to the streaming user

To enable on-demand snapshots and streaming on new tables, the user configured for streaming must have the expected permissions. These permissions should be applied by the root user. Use the following SQL statement:

```sql theme={null}
-- Grant required privileges on all tables. Check with your database admin for an appropriate mask.
GRANT SELECT, RELOAD, SHOW DATABASES, REPLICATION SLAVE, REPLICATION CLIENT ON *.* TO '<streaming_user>'@'%';
```

Replace `<streaming_user>` with the name of the user configured for streaming.

By following these steps, you ensure that new tables added to the pipeline will be properly configured for on-demand snapshots and streaming, allowing historical data to be captured without losing synchronization with the target. If on-demand snapshots are disabled, new tables will only capture changes from the point of addition and the pipeline will have a **STREAMING** status immediately.
