This topic describes how to use Data Management (DMS) or a client to connect to a PolarDB database cluster.
Prerequisites
- A privileged account or standard account for a database cluster is created. For more information, see Create database accounts.
- The host IP address that you use to connect to the PolarDB cluster is added to the whitelist. For more information, see Configure a whitelist for a cluster.
Use DMS to connect to a PolarDB cluster
DMS provides an integrated solution for data management. DMS supports data management, schema management, access security, BI charts, data trends, data tracking, performance optimization, and server management. DMS allows you to manage relational databases such as MySQL, SQL Server, and PostgreSQL, as well as NoSQL databases such as MongoDB and Redis. You can also use DMS to manage Linux servers.
Use a client to connect to a PolarDB cluster
You can also use the pgAdmin 4 client to connect to a PolarDB cluster.
Use a command line tool to connect to a PolarDB-O cluster
In addition to the preceding methods to connect to a PolarDB database cluster, you can also download and install a client and use the command line tool to connect to a PolarDB database cluster.
Next
Troubleshooting
- The IP address whitelist is invalid.
- The whitelist contains only the default IP address 127.0.0.1. 127.0.0.1 indicates that no IP address is allowed to connect to the PolarDB cluster. Therefore, you must add IP addresses to the whitelist. For more information, see Configure a whitelist for a cluster.
- You have added 0.0.0.0 to the whitelist. However, the correct format is 0.0.0.0/0.
Notice The CIDR block 0.0.0.0/0 indicates that all IP addresses are allowed to connect to the PolarDB cluster. Proceed with caution when you add this CIDR block to the whitelist.
- The public IP address you add to the whitelist may not be the actual IP address of the server that connects to the database cluster. For example, the public IP address may be a dynamic IP address. The tools or websites used to query public IP addresses provide invalid IP addresses.
- The private or public IP address is used in an invalid manner.
The connection fails if you use a private IP address to connect to a cluster over the Internet or use a public IP address to connect to a cluster over an internal network.
Use an IP address in a valid manner to connect to a cluster. If you want to connect to the PolarDB cluster over an internal network, use a private IP address of the PolarDB cluster. If you want to connect to the PolarDB cluster over the Internet, use a public IP address of the PolarDB cluster.
- A Domain Name System (DNS) server fails to resolve an IP address.
- If you enter an invalid IP address of a PolarDB-O cluster, check whether one of the
following situations occur:
- You enter an invalid IP address of the cluster. In this case, you can view the valid IP address in the console. For more information about how to view an IP address, see Procedure.
- You use a public IP address to connect to the cluster. However, the IP address is deleted.
- Some applications have limits on the length of IP addresses and the IP address you enter is truncated.
- If the IP address of the PolarDB-O cluster is valid, you can change the IP address
of the DNS server to that of the Alibaba Cloud DNS server.
Network type IP address of the Alibaba Cloud DNS server Internal network (classic network) 10.143.22.116 10.143.22.118
Internal network (virtual private cloud) 100.100.2.136 100.100.2.138
Internet 223.5.5.5 223.6.6.6
- If you enter an invalid IP address of a PolarDB-O cluster, check whether one of the
following situations occur: