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.
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 and 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 for 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, ECS and RDS instances 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
- 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.
- Start the pgAdmin 4 client.
- Right-click Servers and choose from the shortcut menu.
- On the General tab of the Create - Server dialog box, enter the name of the server, as shown in the following figure.
- Click the Connection tab, and enter the information of the target RDS instance, as shown in the following
Host name/address: the connection address of the RDS instance. If it is an internal connection, enter the internal IP address of the RDS instance. If it is an external connection, enter the public IP address of the RDS instance. To view the connection address and the port information of the RDS instance, take these steps:
- Log on to the RDS console.
- In the upper-left corner, select the region where the target instance is located.
- Find the target instance and click its ID.
- On the Basic Information page, find the Internet/intranet IP address and Internet/intranet port number of
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 initial account name for the RDS instance.
Password: the password of the initial account for the RDS instance.
- Click Save.
- If the connection information is correct, choose 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.