• Relational Database Service

rds
  1. Help Center
  2. Relational Database Service
  3. User Guide
  4. FAQs
  5. Connection and Access FAQs
  6. What Should I Do If an ECS Cannot Connect to an RDS DB Instance?

What Should I Do If an ECS Cannot Connect to an RDS DB Instance?

Perform the following steps to identify the problem:

  1. Check whether the ECS and RDS DB instance 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 a security group has been added to the ECS.

    • If a security group has been added, check whether its configuration rules are suitable.

      For details about RDS for MySQL, see the description of security groups in section Creating a DB Instance. Then, go to 3.

      For details about RDS for PostgreSQL, see the description of security groups in section Creating an RDS PostgreSQL DB Instance. Then, go to 3.

      For details about RDS for Microsoft SQL Server, see the description of security groups in section Creating a DB Instance. Then, go to 3.

    • If no security group has been added, go to the VPC console from the ECS details page and click Security Groups to add a security group.

  3. Check whether the ECS can connect to the RDS DB instance port.

    The default port of RDS for MySQL is 3306.

    The default port of RDS for PostgreSQL is 5432.

    The default port of RDS for Microsoft SQL Server is 1433.

    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.
    • If the ECS cannot connect to the port, contact technical support.