Help Center> Relational Database Service> User Guide (Ankara Region)> FAQs> Database Connection> What Should I Do If an ECS Cannot Connect to an RDS DB Instance Through a Private Network?
Updated on 2024-04-11 GMT+08:00

What Should I Do If an ECS Cannot Connect to an RDS DB Instance Through a Private Network?

Perform the following steps to identify the problem:

  1. Check whether the ECS and RDS DB instances are located in the same VPC.

    • If they are in the same VPC, go to 2.
    • If they are in different VPCs, create an ECS in the VPC in which the RDS DB instance is located.

  2. Check whether the security group rules of the ECS instance are appropriate.

    For MySQL DB instances, see the security group description in Step 1: Create a DB Instance. Then, go to 3.

    For PostgreSQL DB instances, see the security group description in Step 1: Create a DB Instance. Then, go to 3.

  3. On the ECS, check whether the RDS DB instance port can be connected.

    The default port of RDS for MySQL is 3306.

    The default port of RDS for PostgreSQL is 5432.

    telnet <IP address> {port number}
    • If the ECS can connect to the RDS DB instance port, the network between the ECS and the RDS DB instance is normal and no further action is required.
    • If the ECS still cannot connect to the port, contact technical support.