This topic describes how to connect to an ApsaraDB for RDS instance over the Internet or an internal network. We recommend that you establish a connection over an internal network to ensure data security and transmission efficiency.

Connect to an RDS instance over the Internet

Log on to the ApsaraDB for RDS console, find the RDS instance, and navigate to the Database Connection page to apply for a public endpoint. By default, an RDS instance is not provided with a public endpoint.

Note
  • For security purposes, exercise caution when you connect to an RDS instance by using its public endpoint.
  • For faster transmission and higher data security, we recommend that you migrate your application to an ECS instance located in the same region and with the same network type as your RDS instance and then connect to your RDS instance by using its internal endpoint.

After you obtain a public endpoint, you can use it to connect to your RDS instance. For more information, see References.

Connect to an RDS instance over an internal network

Log on to the ApsaraDB for RDS console, find the RDS instance, and navigate to the Database Connection page to obtain the internal endpoint of the RDS instance.

Requirements

In normal cases, you can only connect to your RDS instance over an internal network from an ECS instance. To connect to your RDS instance from an on-premises data center, you must establish a physical connection between them. For more information, see Connect an on-premises data center to a VPC through a physical connection.

When you connect to your RDS instance over an internal network from an ECS instance, make sure that the following requirements are met:

  • The ECS and RDS instances are created by the same Alibaba Cloud account.
  • The ECS and RDS instances reside in the same region.
  • The ECS and RDS instances have the same network type.
  • If the ECS and RDS instances both have the VPC network type, they must reside in the same VPC.
  • The private IP address of the ECS instance is added to an IP address whitelist of the RDS instance. For more information, see Configure a whitelist.

If all the preceding requirements are met, you can connect to the RDS instance by using its internal endpoint from the ECS instance. For more information, see References.

FAQ

  • How do I disable the connection established over the Internet to an RDS instance?

    Make sure that the whitelists of the RDS instance only contain private IP addresses. Alternatively, you can release the public endpoint of the RDS instance on the Database Connection page.

  • Why am I unable to change the network type of an RDS instance from VPC to Classic Network?

    The RDS instance only supports the VPC network type. For more information, see Change the network type of an ApsaraDB RDS MySQL instance.

  • Why is my RDS instance disconnected from an ECS instance even though the public IP address of the ECS instance is added to an IP address whitelist of my RDS instance?

    The public IP address of the ECS instance may have changed. In such cases, you must add the new public IP address of the ECS instance to an IP address whitelist of your RDS instance.

References