This topic describes how to configure endpoints for an RDS for MySQL instance. ApsaraDB for RDS provides two types of endpoints: internal endpoints and public endpoints.

Internal and public endpoints

Endpoint type Description
Internal endpoint
  • The internal endpoint is provided by default. You do not need to apply for it and cannot release it. However, you can change the network type.
  • If your application is deployed to an ECS instance that is in the same region and has the same network type as the RDS instance, the RDS instance and the ECS instance can communicate each other by default. You do not need to apply for a public endpoint for the RDS instance.
  • Accessing an RDS instance through the internal endpoint achieves the high security and performance of the RDS instance.
Public endpoint
  • You must manually apply for a public endpoint. You can release the public endpoint if you do not need it.
  • When you cannot access an RDS instance through the internal endpoint, you must apply for a public endpoint. The following section describes the specific scenarios:
    • When you access an RDS instance from an ECS instance, where the ECS instance and RDS instance are located in different regions, and the network types are different.
    • When you access an RDS instance from the third-party services or applications.
Note
  • For the security of your instance, use caution when you access RDS instances through a public endpoint.
  • We recommend that you migrate your application to an ECS instance in the same region and with the same network type as your RDS instance, and then use the internal endpoint to access your applications. This helps to improve transmission speed and data security.

Apply for or release a public endpoint

  1. Log on to the RDS console.
  2. In the upper-left corner of the page, select the region where the instance is located.
    Select a region
  3. Find the instance and click the instance ID.
  4. In the left-side navigation pane, select Database Connections.
    • If you have not applied for a public endpoint, click Apply for Public Endpoint.
    • If you have applied for a public endpoint, click Release Public Endpoint.

    申请外网地址
    释放外网地址
  5. In the message box that appears, click OK.

Change a public endpoint

  1. Log on to the RDS console.
  2. In the upper-left corner of the page, select the region where the instance is located.
    Select a region
  3. Find the instance and click the instance ID.
  4. In the left-side navigation pane, select Database Connections.
  5. Click Change Endpoint.
  6. In the dialog box that appears, specify the internal and public endpoints, and click OK.
    变更连接地址
    Note
    • The prefix of the endpoint must be 8 to 64 characters in length and can contain letters, numbers, and hyphens (-). It must start with a lowercase letter.
    • In a VPC, either the internal port number or public port number cannot be changed.
    • In a classic network, either the internal port number or public port number can be changed.

APIs

Operation Description
AllocateInstancePublicConnection Used to apply for a public endpoint for an RDS instance.
ReleaseInstancePublicConnection Used to release the public endpoint of an RDS instance.