> For the complete documentation index, see [llms.txt](https://upsolver.gitbook.io/content/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://upsolver.gitbook.io/content/how-to-guides-1/connectors/enable-cdc/mysql.md).

# MySQL

This article guides you through the process of enabling CDC on your MySQL database.

## Prerequisites for MySQL

Upsolver supports MySQL 5.6+ and 8.0.x. You can connect to:

* Generic MySQL (self-hosted)
* Amazon RDS MySQL
* Amazon Aurora MySQL

#### Permissions <a href="#permissions" id="permissions"></a>

In order for Upsolver to read the binlog and initial state of the database, the CDC data source requires the following permissions:

* `SELECT` (on the tables that are to be loaded, usually all tables)
* `REPLICATION CLIENT`
* `REPLICATION SLAVE`
* `RELOAD`
* `SHOW DATABASES` (this is only necessary if the server was started with the --skip-show-database option)

For more information about creating a user with the correct permissions, see the [Debezium instructions for configuring MySQL](https://debezium.io/documentation/reference/connectors/mysql.html#setting-up-mysql).

#### Enabled binlog <a href="#enabled-binlog" id="enabled-binlog"></a>

The binlog must be enabled in `ROW` mode. You can follow the [Debezium guide for MySQL](https://debezium.io/documentation/reference/connectors/mysql.html#enable-mysql-binlog) to check if it is enabled and configure it if you are using your own MySQL server: ​

If you are using **AWS RDS** you will need to:

1. Ensure that [Automated Backups](https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_WorkingWithAutomatedBackups.html) are enabled. If not, the binlog will be disabled regardless of the parameter group settings.
2. Change the binlog mode to `ROW` in the parameter group settings for the cluster:
   1. Create a new parameter group based on the base group that matches your database version.
   2. Change the `BINGLOG_FORMAT` to `ROW`
   3. Change the database cluster to use the new parameter group and apply the changes.

#### Ensure binlog duration is long enough <a href="#ensure-binlog-duration-is-long-enough" id="ensure-binlog-duration-is-long-enough"></a>

Upsolver constantly reads the binlog's latest events, so generally the binlog retention only needs to be set high enough to handle server interruptions or situations where the data source or compute cluster is paused in Upsolver. It is therefore recommended to set the binlog retention to **1 day**, and generally not recommended to set it below **3 hours**.&#x20;

Using AWS RDS, this can be achieved using the following command:

```
call mysql.rds_set_configuration('binlog retention hours', 24);
```

Please consult the documentation for your versions of MySQL for custom deployments.&#x20;


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://upsolver.gitbook.io/content/how-to-guides-1/connectors/enable-cdc/mysql.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
