This topic describes how to connect to an RDS PPAS instance. After completing the initial configuration, you can connect to your RDS instance from an ECS instance or your computer.

You can use a database client or Data Management Service (DMS) to connect to an RDS instance. This topic describes how to connect to an RDS instance by using DMS and the pgAdmin 4 client.

Background information

You can log on to DMS from the RDS console and then connect to an RDS instance. DMS offers an integrated solution for data and schema management, access security, BI charts, data trends, data tracking, performance optimization, and server management. DMS can be used to manage non-relational databases and relational databases, such as MySQL, SQL Server, PostgreSQL, MongoDB, and Redis. It can also be used to manage Linux servers.

You can also use a database client to connect to an RDS instance. ApsaraDB RDS PPAS is fully compatible with PPAS. You can connect to RDS in the similar way you connect to an on-premises PPAS server. This topic describes how to use the pgAdmin 4 client to connect to an RDS instance. This topic also serves as a reference if you choose to use other database clients. When you use a client to connect to an RDS instance, you must set internal and public IP addresses as follows:

  • If your client is deployed in an ECS instance and the instance is in the same region and has the same network type as the target RDS instance, then you can use the internal IP address. For example, the ECS instance and RDS instance are both in the VPC located in China (Hangzhou). You can use the internal IP address provided to create a secure connection.
  • Use the public IP address for other situations.

Use DMS to connect to an RDS instance

For more information about how to connect to an RDS instance through DMS, see Log on to the RDS database through DMS.

Use a client to connect to an RDS instance

  1. Add the IP address that is used to access the RDS instance to the RDS whitelist. For more information about how to configure a whitelist, see Configure a whitelist for an RDS PPAS instance.
  2. Start the pgAdmin 4 client.
  3. Right-click Servers and choose Create > Server from the shortcut menu. pgAdmin 4 client
  4. On the General tab of the Create - Server dialog box, enter the name of the server, as shown in the following figure. Create - Server dialog box - General tab
  5. Click the Connection tab, and enter the information of the target RDS instance, as shown in the following figure. Create - Server dialog box - Connection tab

    Parameter description:

    • Host name/address: the endpoint of the RDS instance. If it is an internal connection, enter the internal endpoint of the RDS instance. If it is an external connection, enter the public endpoint of the RDS instance. To view the endpoint and the port information of the RDS instance, follow these steps:
      1. Log on to the RDS console.
      2. In the upper-left corner, select the region where the target instance is located.
      3. Find the target instance and click its ID.
      4. On the Basic Information page, find the internal and public endpoints and port numbers of the RDS instance. Basic Information
    • Port: the port number of the RDS instance. If it is an internal connection, enter the port number for internal connections. If it is an external connection, enter the port number for external connections.
    • Username: the name of the premier account for the RDS instance.
    • Password: the password of the premier account for the RDS instance.
  6. Click Save.
  7. If the connection information is correct, choose Servers > Server Name > Databases > edb or postgres. The following page is displayed, which indicates that the connection to the RDS instance is successful.
    Note Edb and postgres are default system databases of the RDS instance. Do not perform any operation in the two databases.
    Connection information