Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions tidb-cloud/migrate-from-mysql-using-data-migration.md
Original file line number Diff line number Diff line change
Expand Up @@ -438,11 +438,16 @@ For production workloads, it is recommended to have a dedicated user for data du
| `RELOAD` | Global | Ensures consistent snapshots during full dump |
| `REPLICATION SLAVE` | Global | Enables binlog streaming for incremental data migration |
| `REPLICATION CLIENT` | Global | Provides access to binlog position and server status |
| `LOCK TABLES` | Tables | Required when the source is a managed MySQL service (such as Amazon RDS, Aurora, ApsaraDB RDS for MySQL, Azure Database for MySQL, or Google Cloud SQL) where `FLUSH TABLES WITH READ LOCK` is not permitted. In this case, DM falls back to `LOCK TABLES` for consistency during full data export. Not required for self-managed MySQL instances where FTWRL is available. |

For example, you can use the following `GRANT` statement in your source MySQL instance to grant corresponding privileges:

```sql
-- For self-managed MySQL:
GRANT SELECT, RELOAD, REPLICATION SLAVE, REPLICATION CLIENT ON *.* TO 'dm_source_user'@'%';

-- For managed MySQL (Amazon RDS, Aurora, etc.), also grant LOCK TABLES:
GRANT SELECT, RELOAD, LOCK TABLES, REPLICATION SLAVE, REPLICATION CLIENT ON *.* TO 'dm_source_user'@'%';
```

#### Grant required privileges in the target TiDB Cloud cluster
Expand Down
14 changes: 14 additions & 0 deletions tidb-cloud/tidb-cloud-dm-precheck-and-troubleshooting.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,20 @@ Failed to create a schema in the downstream TiDB cluster. This error means that

To resolve this issue, you can create a schema in the TiDB cluster based on a [supported collation](/character-set-and-collation.md#character-sets-and-collations-supported-by-tidb), and then resume the task by clicking **Restart**.

### Error message: "LOCK TABLES ... Access denied"

The full data export failed because the source database user does not have the `LOCK TABLES` privilege. This error typically occurs when migrating from a managed MySQL service (such as Amazon RDS, Aurora, ApsaraDB RDS for MySQL, Azure Database for MySQL, or Google Cloud SQL) where `FLUSH TABLES WITH READ LOCK` (FTWRL) is not permitted by the cloud provider. In this case, DM's default `consistency=auto` mode falls back to `LOCK TABLES` for data consistency during full export, which requires this privilege.

> **Note:** This error can also occur on self-managed MySQL instances if FTWRL is unavailable for other reasons (for example, missing `RELOAD` privilege).

To resolve this issue, grant the missing privilege to the migration user in the source MySQL database:

```sql
GRANT LOCK TABLES ON *.* TO 'dm_source_user'@'%';
```

Then resume the task by clicking **Restart**.

## Alerts

You can subscribe to TiDB Cloud alert emails to be informed in time when an alert occurs.
Expand Down
Loading