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
10 changes: 7 additions & 3 deletions dm/dm-precheck.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,13 @@ For the full data migration mode (`task-mode: full`), in addition to the [common

* (Mandatory) dump permission of the upstream database

- SELECT permission on INFORMATION_SCHEMA and dump tables
- RELOAD permission if `consistency=flush`
- LOCK TABLES permission on the dump tables if `consistency=flush/lock`
- `SELECT` permission on `INFORMATION_SCHEMA` and dump tables
- `RELOAD` permission if `consistency=flush`
- `LOCK TABLES` permission on the dump tables if `consistency=lock`

> **Note:**
>
> When `consistency=auto` (the default), DM first tries `FLUSH TABLES WITH READ LOCK` (FTWRL). If FTWRL is unavailable, DM falls back to `LOCK TABLES`. This fallback commonly occurs on managed MySQL services (such as Amazon RDS, Aurora, ApsaraDB RDS for MySQL, Azure Database for MySQL, and Google Cloud SQL), where FTWRL is not permitted. In this case, the `LOCK TABLES` privilege is required at runtime, but the precheck does not currently verify this privilege. For the full list of privileges, see [DM-worker privileges](/dm/dm-worker-intro.md#upstream-database-user-privileges).
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

low

According to the Repository Style Guide (line 43), avoid passive voice. Additionally, remove unnecessary words like "currently" (line 24) and address the user directly (line 22).

Suggested change
> When `consistency=auto` (the default), DM first tries `FLUSH TABLES WITH READ LOCK` (FTWRL). If FTWRL is unavailable, DM falls back to `LOCK TABLES`. This fallback commonly occurs on managed MySQL services (such as Amazon RDS, Aurora, ApsaraDB RDS for MySQL, Azure Database for MySQL, and Google Cloud SQL), where FTWRL is not permitted. In this case, the `LOCK TABLES` privilege is required at runtime, but the precheck does not currently verify this privilege. For the full list of privileges, see [DM-worker privileges](/dm/dm-worker-intro.md#upstream-database-user-privileges).
> When `consistency=auto` (the default), DM first tries `FLUSH TABLES WITH READ LOCK` (FTWRL). If FTWRL is unavailable, DM falls back to `LOCK TABLES`. This fallback commonly occurs on managed MySQL services (such as Amazon RDS, Aurora, ApsaraDB RDS for MySQL, Azure Database for MySQL, and Google Cloud SQL) that do not permit FTWRL. In this case, you must grant the `LOCK TABLES` privilege at runtime, because the precheck does not verify it. For the full list of privileges, see [DM-worker privileges](/dm/dm-worker-intro.md#upstream-database-user-privileges).
References
  1. Avoid passive voice overuse. (link)
  2. Avoid unnecessary words and repetition. (link)
  3. Write in second person ("you") when addressing users. (link)


* (Mandatory) Consistency of upstream MySQL multi-instance sharding tables

Expand Down
10 changes: 10 additions & 0 deletions dm/dm-worker-intro.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,13 +51,23 @@ The upstream database (MySQL/MariaDB) user must have the following privileges:
| `REPLICATION SLAVE` | Global |
| `REPLICATION CLIENT` | Global |

> **Note:**
>
> If you migrate 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, also grant the `LOCK TABLES` privilege. With the default `consistency=auto` setting, DM falls back to `LOCK TABLES` when FTWRL is unavailable.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

low

According to the Repository Style Guide (line 43), avoid passive voice. Also, remove the redundant word "also" (line 24).

Suggested change
> If you migrate 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, also grant the `LOCK TABLES` privilege. With the default `consistency=auto` setting, DM falls back to `LOCK TABLES` when FTWRL is unavailable.
> If you migrate from a managed MySQL service (such as Amazon RDS, Aurora, ApsaraDB RDS for MySQL, Azure Database for MySQL, or Google Cloud SQL) that does not permit `FLUSH TABLES WITH READ LOCK` (FTWRL), grant the `LOCK TABLES` privilege. With the default `consistency=auto` setting, DM falls back to `LOCK TABLES` when FTWRL is unavailable.
References
  1. Avoid passive voice overuse. (link)
  2. Avoid unnecessary words and repetition. (link)


If you need to migrate the data from `db1` to TiDB, execute the following `GRANT` statement:

```sql
GRANT RELOAD,REPLICATION SLAVE, REPLICATION CLIENT ON *.* TO 'your_user'@'your_wildcard_of_host';
GRANT SELECT ON db1.* TO 'your_user'@'your_wildcard_of_host';
```

For managed MySQL services where `FLUSH TABLES WITH READ LOCK` (FTWRL) is not permitted, also grant the `LOCK TABLES` privilege:
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

low

According to the Repository Style Guide (line 43), avoid passive voice. Also, remove the redundant word "also" (line 24).

Suggested change
For managed MySQL services where `FLUSH TABLES WITH READ LOCK` (FTWRL) is not permitted, also grant the `LOCK TABLES` privilege:
For managed MySQL services that do not permit `FLUSH TABLES WITH READ LOCK` (FTWRL), grant the `LOCK TABLES` privilege:
References
  1. Avoid passive voice overuse. (link)
  2. Avoid unnecessary words and repetition. (link)


```sql
GRANT LOCK TABLES ON db1.* TO 'your_user'@'your_wildcard_of_host';
```

If you also need to migrate the data from other databases into TiDB, make sure the same privileges are granted to the user of the respective databases.

### Downstream database user privileges
Expand Down
8 changes: 8 additions & 0 deletions dm/quick-start-with-dm.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,10 @@ You can use Docker to quickly deploy a test MySQL 8.0 instance.
GRANT PROCESS, BACKUP_ADMIN, RELOAD, REPLICATION SLAVE, REPLICATION CLIENT, SELECT ON *.* TO 'tidb-dm'@'%';
```

> **Note:**
>
> If your MySQL source is a managed MySQL service (such as Amazon RDS, Aurora, ApsaraDB RDS for MySQL, Azure Database for MySQL, or Google Cloud SQL), also grant the `LOCK TABLES` privilege. For more information, see [DM-worker privileges](/dm/dm-worker-intro.md#upstream-database-user-privileges).
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

low

According to the Repository Style Guide (line 24), avoid unnecessary words like "also".

Suggested change
> If your MySQL source is a managed MySQL service (such as Amazon RDS, Aurora, ApsaraDB RDS for MySQL, Azure Database for MySQL, or Google Cloud SQL), also grant the `LOCK TABLES` privilege. For more information, see [DM-worker privileges](/dm/dm-worker-intro.md#upstream-database-user-privileges).
> If your MySQL source is a managed MySQL service (such as Amazon RDS, Aurora, ApsaraDB RDS for MySQL, Azure Database for MySQL, or Google Cloud SQL), grant the `LOCK TABLES` privilege. For more information, see [DM-worker privileges](/dm/dm-worker-intro.md#upstream-database-user-privileges).
References
  1. Avoid unnecessary words and repetition. (link)


4. Create sample data:

```sql
Expand Down Expand Up @@ -147,6 +151,10 @@ On macOS, you can quickly install and start MySQL 8.0 locally using [Homebrew](h
GRANT PROCESS, BACKUP_ADMIN, RELOAD, REPLICATION SLAVE, REPLICATION CLIENT, SELECT ON *.* TO 'tidb-dm'@'%';
```

> **Note:**
>
> If your MySQL source is a managed MySQL service (such as Amazon RDS, Aurora, ApsaraDB RDS for MySQL, Azure Database for MySQL, or Google Cloud SQL), also grant the `LOCK TABLES` privilege. For more information, see [DM-worker privileges](/dm/dm-worker-intro.md#upstream-database-user-privileges).
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

low

According to the Repository Style Guide (line 24), avoid unnecessary words like "also".

Suggested change
> If your MySQL source is a managed MySQL service (such as Amazon RDS, Aurora, ApsaraDB RDS for MySQL, Azure Database for MySQL, or Google Cloud SQL), also grant the `LOCK TABLES` privilege. For more information, see [DM-worker privileges](/dm/dm-worker-intro.md#upstream-database-user-privileges).
> If your MySQL source is a managed MySQL service (such as Amazon RDS, Aurora, ApsaraDB RDS for MySQL, Azure Database for MySQL, or Google Cloud SQL), grant the `LOCK TABLES` privilege. For more information, see [DM-worker privileges](/dm/dm-worker-intro.md#upstream-database-user-privileges).
References
  1. Avoid unnecessary words and repetition. (link)


6. Create sample data:

```sql
Expand Down
Loading