This topic uses an ApsaraDB RDS for MySQL instance as an example to describe how to register a database instance that is accessible to multiple Alibaba Cloud accounts in Data Management Service (DMS).

Background information

If you need to allow multiple Alibaba Cloud accounts in your enterprise to manage all the database instances in a uniform manner, you can add multiple users in DMS before you add these database instances. All the added DMS users in your enterprise can access these database instances.

Usage notes

  • Only the ApsaraDB RDS for MySQL, ApsaraDB RDS for SQL Server, ApsaraDB RDS for PPAS, and ApsaraDB RDS for PostgreSQL instances are accessible to multiple Alibaba Cloud accounts.
  • When you add a database instance that is accessible to multiple Alibaba Cloud accounts, you must enter a connection string instead of an instance ID for logging on to the database instance.
  • You can add only database instances that are owned by users under your account. Otherwise, an error occurs, as shown in the following figure.Addition failure

Add a user

  1. Log on to the DMS console.
  2. In the top navigation bar, choose System Management > User.
  3. On the User page, click New in the upper-left corner.
    Add User dialog box
  4. In the Add User dialog box, enter an Alibaba Cloud account ID in the Alibaba Cloud Account field.
    Alibaba Cloud Account field
    Note The account owner can view the Alibaba Cloud account ID on the Security Settings page, as shown in the following figure.View your Alibaba Cloud account ID
  5. Select a role for the user to be added.
    Note
    • Common User: This user can only log on to the DMS console and is required to apply for permissions to perform other operations. For more information, see Common user manual.
    • DBA: This user has permissions to query all databases and tables, and manage instances, tasks, security rules, and configurations. Database administrators (DBAs) can submit tickets to apply for corresponding permissions but not tickets of other types. For more information, see DBA manual.
    • Administrator: This user has permissions to query all databases and tables, and manage instances, tasks, security rules, configurations, users, operations logs, and IP addresses in the DMS whitelist. DMS administrators can submit tickets to apply for corresponding permissions but not tickets of other types. For more information, see Administrator manual.
    • Security Administrator: This user has permissions to query all databases and tables, use the Intelligent Operation and Data Protection features, and manage operations logs, sensitive data, permissions, schemas, and data plans. Security administrators can submit tickets to apply for corresponding permissions but not tickets of other types. For more information, see Security administrator manual.
  6. Click OK.

Add a database instance

  1. Log on to the DMS console.
  2. In the left-side navigation pane, move the pointer over Add instance / Batch entry and select Add instance. The Add instance dialog box appears.
    Add instance dialog box
  3. In the Add instance dialog box, the Cloud tab appears.
  4. On the Cloud tab, click MySQL.
  5. In the Add instance dialog box, set the parameters as required.
    Section Parameter Description
    Basic Information Database Source The source of the database instance to add. In this example, select Cloud.
    Database type The type of the database instance.
    Instance Area The region where the database instance resides.
    Entry mode The method that you can use to log on to the database instance. To add a database instance that is accessible to multiple Alibaba Cloud accounts, you must select Connection string address.
    Connection string address The endpoint for connecting to the database instance.
    Note When you add an ApsaraDB instance, DMS automatically adds the Classless Inter-Domain Routing (CIDR) blocks of the specified region in the DMS whitelist to the whitelist of the ApsaraDB instance. If the CIDR blocks fail to be automatically added, you can add them manually. For more information, see Configure a whitelist for an ApsaraDB RDS for MySQL instance and Set IP addresses in the DMS whitelist.
    Database account The username that you can use to log on to the database.
    Database password The password that you can use to log on to the database.
    Control Mode The control mode that is used to manage the database instance in DMS. For more information, see Control modes.
    Advanced information Environment type The environment of the database instance.
    Instance Name The name of the database instance.
    Enable DSQL Specifies whether to enable the cross-database query feature for the database instance. For more information, see Cross-database query.
    OnlineDDL Specifies whether to allow changing schemas without locking tables for the database instance and the specific method. For more information, see Change schemas without locking tables.
    DBA The DBA of the database instance, who is allowed to grant permissions to users.
    query timeout(s) The timeout period for the execution of an SQL query statement. If the execution of an SQL query statement lasts longer than the specified timeout period, the execution of the statement will be terminated to protect the database.
    export timeout(s) The timeout period for the execution of an SQL export statement. If the execution of an SQL export statement lasts longer than the specified timeout period, the execution of the statement will be terminated to protect the database.
  6. In the Basic Information section, click Test connection in the lower-left corner. Wait until the connectivity test is passed.
    Note If the test fails, check the parameter values that you have specified.
  7. Click Submit.