This topic provides answers to some frequently asked questions about connections in AnalyticDB for MySQL.
FAQ overview
What do I do if the Can't connect to MySQL server error occurs?
What do I do if I failed to connect to an AnalyticDB for MySQL cluster?
Why am I unable to use the EasySwoole framework to connect to AnalyticDB for MySQL?
How do I check the user or client IP address from which burst connections are established?
What do I do if the Can't connect to MySQL server
error occurs?
If the Can't connect to MySQL server
error occurs when you connect to an AnalyticDB for MySQL cluster, this error may be caused by incorrect IP address whitelist settings.
Perform the following steps to check the IP address whitelist settings:
Check whether the correct public IP address of the client is used.
ECS instance
Log on to the Elastic Compute Service (ECS) console, find the ECS instance that is used to connect to an AnalyticDB for MySQL cluster, and view and copy the IP address of the ECS instance.
If you use the private endpoint of the AnalyticDB for MySQL cluster, copy the private IP address. Otherwise, copy the public IP address.
On-premises client
On the terminal or in the Command Prompt (CMD) window of an on-premises device, run the
curl ipinfo.io/ip
command to obtain the public IP address of the on-premises device.Add the public IP address of the client obtained in Step 1 to an IP address whitelist of the AnalyticDB for MySQL cluster.
Reconnect to the AnalyticDB for MySQL cluster.
What do I do if the Unknown MySQL server host
error occurs?
If the Unknown MySQL server host
error occurs when you connect to an AnalyticDB for MySQL cluster, this error may be caused by an incorrect endpoint.
Check whether the endpoint of the AnalyticDB for MySQL cluster is correctly spelled. If yes, perform the following steps to check the endpoint:
Run the
ping <endpoint of AnalyticDB for MySQL>
command to check the network connectivity.Network connection failures may be caused by the following reasons:
You connect to the AnalyticDB for MySQL cluster from an on-premises device by using a Virtual Private Cloud (VPC) endpoint. VPC endpoints can be used for connections only within the same VPC. However, on-premises devices do not belong to VPCs. As a result, the network connection fails.
You connect to the AnalyticDB for MySQL cluster from an ECS instance, but the ECS instance does not reside in the same VPC as the AnalyticDB for MySQL cluster. As a result, the network connection fails.
You can check the VPC IDs in the ECS console and the AnalyticDB for MySQL console. If the VPC IDs are different, the ECS instance and the AnalyticDB for MySQL cluster do not reside in the same VPC. In this case, use the public endpoint of the AnalyticDB for MySQL cluster or change the VPC of the AnalyticDB for MySQL cluster.
VPC ID of the ECS instance
VPC ID of the AnalyticDB for MySQL cluster
Log on to the AnalyticDB for MySQL console. View and copy the public endpoint of the AnalyticDB for MySQL cluster.
If no public endpoint is displayed in the console, you must apply for a public endpoint. Click Apply for Endpoint. You are not charged for applying for a public endpoint.
Run the
ping <public endpoint of AnalyticDB for MySQL>
command.If the endpoint is correct, the ping operation is successful.
Reconnect to the AnalyticDB for MySQL cluster by using the public endpoint.
What do I do if I failed to connect to an AnalyticDB for MySQL cluster?
If you failed to connect to an AnalyticDB for MySQL cluster, perform the steps shown in the following figure to identify and resolve the issue.
If the required JDBC connection for a query is closed during the query, is the query terminated on the server?
If the query is asynchronously submitted by using the SUBMIT JOB
, INSERT INTO SELECT
, or CREATE TABLE AS SELECT
statement, the query continues. Otherwise, the query is terminated.
If a JDBC connection remains open when the client times out, are the server resources immediately released?
Yes, the server resources are immediately released.
Why am I unable to use the EasySwoole framework to connect to AnalyticDB for MySQL?
This issue occurs because SHOW statements are not supported in PreparedStatement.
How do I check the user or client IP address from which burst connections are established?
This FAQ applies only to Data Warehouse Edition clusters.
Log on to the AnalyticDB for MySQL console. Find the Data Warehouse Edition cluster that you want to manage and click the cluster ID. In the left-side navigation pane, click Diagnostics and Optimization. On the page that appears, click the Connection Information tab to view the Number of User Connections and Number of Connections to Client IP Address parameters.
What is the maximum number of connections that can be established to an AnalyticDB for MySQL cluster?
The number of connections that can be established to an AnalyticDB for MySQL cluster is not limited but varies based on the cluster specifications. We recommend that you establish no more than 50,000 connections to a cluster. Low-specification clusters cannot support excessive connections due to insufficient resources. For more information, see Limits.