User-created databases on ECS instances are databases that are installed and configured on ECS instances. You can use Data Management Service (DMS) to manage user-created databases on ECS instances. This topic describes how to use DMS to add and manage user-created databases on ECS instances. A MySQL database is used in these examples.

Prerequisites

  1. DMS is activated. For more information, see Activate DMS.
  2. An ECS instance of a memory optimized r-series instance family is created. For more information about how to create an ECS instance, see Create an instance by using the provided wizard.
  3. An inbound rule is added to the security group of the ECS instance to allow traffic for the MySQL database on the listening port. The default listening port number for the MySQL database is 3306.
  4. A MySQL database is installed on the ECS instance. For more information, see Database overview.
  5. A non-root account is created for the MySQL database on the ECS instance.
    Note By default, MySQL databases do not allow remote access from the root account. If you have changed the default settings to allow remote access from the root account, you can skip this step.
    In this example, run the following command to create an account named dms for logging on to the MySQL database, set the password to Ecs123!, and grant all permissions to the account.
    create user 'dms'@'%' IDENTIFIED BY 'Ecs123!' ;
    grant all privileges on *.* to 'dms'@'%' with grant option;
    flush privileges;

Background information

Data Management Service (DMS) is a database management web terminal provided by Alibaba Cloud to help manage user-created databases on ECS instances that run Windows or Linux. You can add user-created databases in the DMS console to use data management features such as creating databases and tables. DMS supports user-created MySQL, SQL Server, PostgreSQL, MongoDB, and Redis databases. For more information, see DMS documentation.

Procedure

  1. Log on to the DMS console.
  2. In the top navigation bar, choose System Management > Instance.
  3. On the Instance List tab, click New.
  4. In the Add instance dialog box that appears, click the ECS Self-built tab.
  5. Click the MySQL icon.
  6. Configure the database parameters.

    The following table describes the parameters to configure.

    Parameter Description
    Database Source Select ECS Self-built.
    Database type The type of the user-created database on the ECS instance. In this example, select MySQL.
    Instance Area The region where the ECS instance is located.
    ECSInstance ID The ID of the ECS instance.
    Port The number of the listening port used to access the database on the ECS instance. In this example, set Port to 3306.
    Database account The account used to log on to the user-created database on the ECS instance. In this example, the account used to log on to the MySQL database is dms.
    Note We recommend that you use a non-root account.
    Database password The password used to log on to the user-created database on the ECS instance. In this example, the password of dms is Ecs123!.
    Control Mode In this example, select Flexible Management. For more information about the control modes, see Control modes.
  7. Click Submit.
  8. Log on to the database.

What to do next

After you log on to the database, you can perform operations on the database by using SQL statements or the DMS console.