Before using the data migration or synchronization feature of OceanBase Migration Service (OMS) Community Edition, you must create dedicated database users in the source and destination databases for the data migration or synchronization task and grant corresponding privileges to these users.
Create drc_user
You need to create a user under the SYS tenant of OceanBase Database, which is used by OMS Community Edition for authentication when it consumes Clog logs from OceanBase Database.
The username and password must be the same with drc_user and drc_password in the OMS Community Edition deployment configuration file config.yaml.
CREATE USER <drc_user> IDENTIFIED BY <drc_password>;
GRANT SELECT ON OCEANBASE.* TO <drc_user>;
Create __oceanbase_inner_drc_user
If you want to migrate data from a table without a primary key, create the __oceanbase_inner_drc_user user and grant privileges to the user as needed before migration.
Create the user
create user __oceanbase_inner_drc_user identified by '<password>';Grant privileges
grant select on *.* to __oceanbase_inner_drc_user;
Create a MySQL/TiDB database user
The procedure for creating and authorizing a MySQL user is the same as that for creating and authorizing a TiDB database user.
Log on to the MySQL/TiDB database.
Create a user in the MySQL/TiDB database for data migration or synchronization.
CREATE USER '<username>'@'<host_name>' IDENTIFIED BY '<password>';Parameter Description username The account to be created. host The host from which the account is allowed to log on to the database. To allow the account to log on to the database from any host, set this parameter to a percent sign (%). password The password of the account. Use the
GRANTstatement to grant privileges to the created database user. For more information, see User privileges.
Create an OceanBase Database user
For more information about how to manage the user privileges of an OceanBase database, see the OceanBase Database Administrator Guide.
Log on to the OceanBase database as the system administrator.
Create a user in the OceanBase database for data migration or synchronization.
CREATE USER '<oms01>' IDENTIFIED BY '<123456>';Use the
GRANTstatement to grant privileges to the created database user. For more information, see User privileges.
Create a PostgreSQL user
Log on to the PostgreSQL database.
Create a user in the PostgreSQL database for data migration or synchronization.
CREATE USER <user_name> ENCRYPTED PASSWORD '<password>';Use the
GRANTstatement to grant privileges to the created database user. For more information, see User privileges.