All Products
Search
Document Center

:DMS fails to connect to a self-managed MySQL database on an ECS instance

Last Updated:Jun 02, 2026

Troubleshoot the error "DMS cannot establish a connection with the MySQL server. Check whether the connection address is correct, the network is unblocked, and the whitelist is configured before trying again."

Problem description

When you use Data Management (DMS) to connect to a self-managed MySQL database on an ECS instance, the following error is returned: "DMS cannot establish a connection with the MySQL server. Check whether the connection address is correct, the network is unblocked, and the whitelist is configured before trying again."

Causes and solutions

Cause

Solution

MySQL is not running on the ECS instance.

  1. Run the following command on the ECS instance to check whether MySQL is running:

    ps -ef | grep mysql
  2. If no MySQL process is listed, start MySQL and reconnect:

    systemctl start mysqld

The ECS firewall blocks the DMS connection.

  1. Verify that the firewall allows traffic on the MySQL port (default: 3306).

  2. If the DMS IP addresses or CIDR blocks are in the firewall whitelist, remove them.

The ECS security group blocks DMS access.

Add a security group rule to allow the DMS IP addresses or CIDR blocks. Add a security group rule.

The MySQL root account allows only localhost connections.

  1. Check whether the root account is restricted to localhost:

    show grants for root@'%';
  2. If access is restricted to localhost, run the following command to allow remote connections:

    use mysql; update user set host = '%' where user = 'root'; FLUSH PRIVILEGES;
    Note
    • The percent sign (%) in the preceding command matches any host. For security, replace % with a specific host address.

    • The root account here refers to the MySQL database account, not the OS root account.

Applicable scope

  • DMS