1
1
---
2
2
title : ' Import tool user permissions'
3
3
subtitle : ' List of the grants required to import a database into PlanetScale using the Import tool'
4
- date : ' 2023-09-21 '
4
+ date : ' 2024-08-19 '
5
5
---
6
6
7
7
When importing a database using our [ Import tool] ( /docs/imports/database-imports ) , you will need to connect to your existing database with a user that has the proper permissions to set up the necessary configurations to start importing data.
8
8
9
9
Below is the minimum set of permissions needed and what each allows the user to do:
10
10
11
- | Scope | Databases | Grant | Description |
12
- | ------ | -------------------------------- | -------------------- | ---------------------------------------------------------------------------- |
13
- | Global | n/a | ` PROCESS ` | Enable the user to see all processes with SHOW PROCESSLIST. |
14
- | Global | n/a | ` REPLICATION SLAVE ` | Enable replicas to read binary log events from the source. |
15
- | Global | n/a | ` REPLICATION CLIENT ` | Enable the user to ask where source or replica servers are. |
16
- | Global | n/a | ` RELOAD ` | Enable use of FLUSH operations. |
17
- | Table | ` <DATABASE_NAME> ` , ` ps_import_* ` | ` SELECT ` | Enable use of SELECT. |
18
- | Table | ` <DATABASE_NAME> ` , ` ps_import_* ` | ` INSERT ` | Enable use of INSERT. |
19
- | Table | ` <DATABASE_NAME> ` | ` LOCK TABLES ` | Enable use of LOCK TABLES on tables for which you have the SELECT privilege. |
20
- | Table | ` <DATABASE_NAME> ` | ` SHOW VIEW ` | Enable use of SHOW VIEW. |
21
- | Table | ` <DATABASE_NAME> ` , ` ps_import_* ` | ` UPDATE ` | Enable use of UPDATE. |
22
- | Table | ` <DATABASE_NAME> ` , ` ps_import_* ` | ` DELETE ` | Enable use of DELETE. |
23
- | Table | ` ps_import_* ` | ` CREATE ` | Enable database and table creation. |
24
- | Table | ` ps_import_* ` | ` DROP ` | Enable databases, tables, and views to be dropped. |
25
- | Table | ` ps_import_* ` | ` ALTER ` | Enable use of ALTER TABLE. |
11
+ | Scope | Databases | Grant | Description |
12
+ | ------ | ------------------------------------------------------- | -------------------- | ---------------------------------------------------------------------------- |
13
+ | Global | n/a | ` PROCESS ` | Enable the user to see all processes with SHOW PROCESSLIST. |
14
+ | Global | n/a | ` REPLICATION SLAVE ` | Enable replicas to read binary log events from the source. |
15
+ | Global | n/a | ` REPLICATION CLIENT ` | Enable the user to ask where source or replica servers are. |
16
+ | Global | n/a | ` RELOAD ` | Enable use of FLUSH operations. |
17
+ | Table | ` <DATABASE_NAME> ` , ` ps_import_* ` , ` _vt ` , ` mysql ` . ` func ` | ` SELECT ` | Enable use of SELECT. |
18
+ | Table | ` <DATABASE_NAME> ` , ` ps_import_* ` , ` _vt ` | ` INSERT ` | Enable use of INSERT. |
19
+ | Table | ` <DATABASE_NAME> ` | ` LOCK TABLES ` | Enable use of LOCK TABLES on tables for which you have the SELECT privilege. |
20
+ | Table | ` <DATABASE_NAME> ` | ` SHOW VIEW ` | Enable use of SHOW VIEW. |
21
+ | Table | ` <DATABASE_NAME> ` , ` ps_import_* ` , ` _vt ` | ` UPDATE ` | Enable use of UPDATE. |
22
+ | Table | ` <DATABASE_NAME> ` , ` ps_import_* ` , ` _vt ` | ` DELETE ` | Enable use of DELETE. |
23
+ | Table | ` ps_import_* ` , ` _vt ` | ` CREATE ` | Enable database and table creation. |
24
+ | Table | ` ps_import_* ` , ` _vt ` | ` DROP ` | Enable databases, tables, and views to be dropped. |
25
+ | Table | ` ps_import_* ` , ` _vt ` | ` ALTER ` | Enable use of ALTER TABLE. |
26
26
27
27
{% callout %}
28
28
The descriptions in the table above were taken from the MySQL docs. For a full list of all possible grants and their
@@ -42,5 +42,7 @@ CREATE USER 'migration_user'@'%' IDENTIFIED BY '<SUPER_STRONG_PASSWORD>';
42
42
GRANT PROCESS, REPLICATION SLAVE, REPLICATION CLIENT, RELOAD ON * .* TO ' migration_user' @' %' ;
43
43
GRANT SELECT , INSERT, UPDATE , DELETE , SHOW VIEW, LOCK TABLES ON ` <DATABASE_NAME>` .* TO ' migration_user' @' %' ;
44
44
GRANT SELECT , INSERT, UPDATE , DELETE , CREATE, DROP, ALTER ON ` ps\_ import\_ %` .* TO ' migration_user' @' %' ;
45
+ GRANT SELECT , INSERT, UPDATE , DELETE , CREATE, DROP, ALTER ON ` _vt` .* TO ' migration_user' @' %' ;
46
+ GRANT SELECT ON ` mysql` .` func` TO ' migration_user' @' %' ;
45
47
GRANT EXECUTE ON PROCEDURE mysql .rds_show_configuration TO ' migration_user' @' %' ;
46
48
```
0 commit comments