This topic describes how to use Data Management Service (DMS) and a client to connect to a PolarDB for PostgreSQL cluster.
- You have created a privileged account or standard account for a database cluster. For more information, see Create database accounts.
- You have added the IP address of the host that you want to connect to the Apsara PolarDB cluster to the whitelist. For more information, see Configure a whitelist for a cluster.
Use DMS to connect to a PolarDB-O cluster
Data Management (DMS) provides an integrated solution for data management. DMS supports data management, schema management, access control, BI charts, trend analysis, data tracing, performance optimization, and server management. DMS supports relational databases such as MySQL, SQL Server, and PostgreSQL, as well as NoSQL databases such as MongoDB and Redis. DMS also supports the management of Linux servers.
- Log on PolarDB console.
- On the top of the page, select the region where the target cluster is located.
- Find the target cluster and click the cluster ID to go to the Overview page.
- In the upper right corner of the Overview page, click Log On to Database to go to the RDS Database Logon page.
- On the RDS Database Logon page, enter the primary endpoint and the port number, and
separate them with a colon (:). Then, enter the username and password of the privileged
or standard account, and click Log On.When you connect to a cluster by using DMS, you can only use a primary endpoint. DMS does not support cluster endpoints.
Use a client to connect to a PolarDB-O cluster
You can also use the pgAdmin 4 client to connect to an Apsara PolarDB cluster.
- Launch the pgAdmin 4 client.
- Right-click Servers and choose , as shown in the following figure.
- On the General tab of the Create - Server dialog box that appears, enter the name of the server, as shown in the following
- Click the Connection tab and specify the information of the destination instance. These parameters are
listed in the following table.
Table 1. Parameters Parameter Description Host name/address
Enter the endpoint of the PolarDB-O cluster. To view the endpoint and port information of the PolarDB-O cluster, perform the following steps:
- Log on to the Apsara PolarDB console.
- In the upper-left corner of the console, select the region where the cluster is deployed.
- Find the target cluster and click the cluster ID.
- In the Endpoints section, view the endpoint and port information.
Port The port of the cluster. Default value: 1521. Maintenance database Enter the maintenance database. Default value: postgres. Username The username of the account of the PolarDB-O cluster. For more information, see Create database accounts. Password The password of the account for the PolarDB-O cluster.
- Click Save.
- If the connection information is valid, the following page appears after you click
the database name. This indicates that the connection is established.
- Right-click the target database and click Query Tool.... On the following page, you can add, delete, update, and query data in the database.