Help Center> Data Admin Service> FAQ> Connection Management> Connection Timed Out Error

Connection Timed Out Error

Possible Causes:

ECS is stopped.

  1. Click the name of the target ECS. The page providing details about the ECS is displayed.
  2. If the ECS is stopped, restart the ECS. After it is restarted, connect to the database again.

The access to the port is not allowed by the ECS security group.

  1. You are advised to select TCP for Protocol/Application, enter the same port number as the self-built database port, and set the IP address to 0.0.0.0/0.

    For details about how to set security group rules, see Configuring Security Group Rules.

    Figure 1 Add Inbound Rule
  2. You are advised to select TCP for Protocol/Application, enter the same port number as the self-built database port, and set the IP address to 0.0.0.0/0.

    For details about how to set security group rules, see Configuring Security Group Rules.

    Figure 2 Add Outbound Rule

The port is not allowed in the ECS iptables.

  1. Locate the target ECS on the ECS console, click Remote Login in the Operation column, and enter the username and password. After successful login, run the following command to check the iptables configuration:

    iptables -S

    The port next to --dport indicates the port that can be accessed.

  2. You can add an iptables rule to allow access to the database port.
  3. You can run the following command to disable the firewall to allow access to the database port.

    systemctl stop iptables

During the remote access to the MySQL databases, DNS resolution is slow. As a result, the connection times out.

  1. Locate the /etc/my.cnf configuration file of the MySQL database, enter the following content under [mysqld], save the modification, and exit.
    skip-name-resolve

    The default location of the MySQL configuration file is /etc/my.cnf. If the location is specified, you need modify it accordingly.

  2. Restart the database service with systemctl restart mysqld. Then, connect to the database again.