This topic describes how to connect to a PolarDB for PostgreSQL cluster.
Use DMS to connect to a PolarDB for PostgreSQL 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.
You have created a privileged or standard account for an existing database cluster. For more information, see Create a database account.
- Find the target cluster and click the cluster ID to go to the basic information page.
- Click Log On to Database in the upper-right corner of the page.
- On the database logon page, enter the endpoint and the port number, and separate them
with a colon (:). Then enter the username and the password of the privileged or standard
account, and click Log On.
Note DMS logon only supports the endpoint and does not support the cluster address.
For more information about how to view the endpoint, see View connection endpoints.
Use a client to connect to a PolarDB for PostgreSQL cluster
PolarDB for PostgreSQL does not support setting a whitelist for a cluster. Only instances that are in the same VPC can access the cluster. Therefore, the server where the client resides and the PolarDB compatible with Oracle cluster must be in the same VPC.
- Start the pgAdmin 4 client.
- Right-click Servers and choose from the shortcut menu, as shown in the following figure.
- 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 instance to connect to, as shown in the following
Hostname or IP Address: the internal IP address of the PolarDB for PostgreSQL cluster. To view the endpoint and port information of the PolarDB for PostgreSQL cluster, follow these steps:
- Log on to the ApsaraDB for PolarDB console.
- Find the target cluster and click the cluster ID.
- In the Connection Information section, view the endpoint and port information.
- Port: the internal port of the PolarDB for PostgreSQL cluster.
- User Name: the name of the privileged account of the PolarDB for PostgreSQL cluster.
- Password: the password of the privileged account of the PolarDB for PostgreSQL cluster.
- Click Save.
- If the connection information is correct, choose Note postgres is the default system database of the PolarDB for PostgreSQL cluster. Do not perform any operation on the database.
. The connection is successful if the following interface is displayed.