Help Center> Data Replication Service> Troubleshooting> Solutions to Failed Check Items> Database User Permissions> Whether the Source Database User Has Sufficient Permissions
Updated on 2024-05-09 GMT+08:00

Whether the Source Database User Has Sufficient Permissions

Check whether the source database user has sufficient permissions. The source database user permissions required in the full and incremental phases vary depending on the DB engine.

Failure Cause

The source database user does not have sufficient permissions.

Handling Suggestion

When you use DRS to migrate or synchronize data, the source database user must have required permissions. Tasks of different DB engines and modes require different account permissions. DRS automatically checks the database account permissions in the pre-check phase and provides handling suggestions.

Take the MySQL migration as an example. The source database user permissions are as follows:

  • Full migration:

    SELECT, SHOW VIEW, and EVENT

    Reference statement: GRANT SELECT, SHOW VIEW, EVENT ON *.* TO 'user1';

  • Full+incremental migration:

    SELECT, SHOW VIEW, EVENT, LOCK TABLES, REPLICATION SLAVE, and REPLICATION CLIENT

REPLICATION SLAVE and REPLICATION CLIENT are global permissions and must be enabled separately. The reference statement is as follows:

GRANT REPLICATION SLAVE, REPLICATION CLIENT ON *.* TO 'user1';

SELECT, SHOW VIEW, EVENT, and LOCK TABLES are non-global permissions. The reference statement is as follows:

GRANT SELECT, SHOW VIEW, EVENT, LOCK TABLES, ON [Database to be migrated].* TO 'user1';