-
Notifications
You must be signed in to change notification settings - Fork 711
dm: add LOCK TABLES privilege note for managed MySQL sources (#22605) #22765
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: release-8.5
Are you sure you want to change the base?
Changes from all commits
25ffb40
799c4f7
3284f29
fcf6616
69adae2
836bdc6
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -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. | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. According to the Repository Style Guide (line 43), avoid passive voice. Also, remove the redundant word "also" (line 24).
Suggested change
|
||||||
|
|
||||||
| 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: | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. According to the Repository Style Guide (line 43), avoid passive voice. Also, remove the redundant word "also" (line 24).
Suggested change
|
||||||
|
|
||||||
| ```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 | ||||||
|
|
||||||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -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). | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. According to the Repository Style Guide (line 24), avoid unnecessary words like "also".
Suggested change
References
|
||||||
|
|
||||||
| 4. Create sample data: | ||||||
|
|
||||||
| ```sql | ||||||
|
|
@@ -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). | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. According to the Repository Style Guide (line 24), avoid unnecessary words like "also".
Suggested change
References
|
||||||
|
|
||||||
| 6. Create sample data: | ||||||
|
|
||||||
| ```sql | ||||||
|
|
||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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).
References