Connections

Updated at:
Copy as MD

Answers to common connection issues with AnalyticDB for MySQL clusters.

Can't connect to MySQL server

This error almost always means the client's IP address isn't in the cluster's whitelist. Fix it in three steps:

  1. Check whether the correct public IP address of the client is used.

    ECS instance

    Log in to the ECS console, find the instance connecting to the cluster, and copy its IP address. Use the private IP if you're connecting through the cluster's private endpoint; use the public IP otherwise. image

    On-premises device

    Run the following command in a terminal or Command Prompt (CMD) window to get the public IP: curl ipinfo.io/ip image

  2. Add the IP address to the cluster's IP address whitelist.

  3. Reconnect to the cluster.

Unknown MySQL server host

This error indicates an incorrect endpoint — either a typo or the wrong endpoint type for your network setup.

First, verify the endpoint spelling. Then run the following command to check connectivity:

ping <endpoint of AnalyticDB for MySQL>

If ping fails, the most common cause is a Virtual Private Cloud (VPC) mismatch:

  • Connecting from an on-premises device using a VPC endpoint — VPC endpoints only work within the same VPC, and on-premises devices are outside any VPC.

  • Connecting from an ECS instance in a different VPC than the cluster.

Check the VPC IDs in both consoles:

VPC ID of the ECS instance VPC ID of the AnalyticDB for MySQL cluster
image image

If the VPC IDs differ, either change the cluster's VPC or switch to the public endpoint. To get the public endpoint:

  1. Log in to the AnalyticDB for MySQL console and copy the public endpoint from the cluster details page.

    If no public endpoint is shown, click Apply for Endpoint. Applying for a public endpoint is free. See Apply for or release a public endpoint for details.
  2. Run ping <public endpoint of AnalyticDB for MySQL> to confirm the endpoint resolves correctly.

  3. Reconnect using the public endpoint.

General connection failure

If you failed to connect to an AnalyticDB for MySQL cluster, use the following troubleshooting flowchart to identify and resolve the issue:

image

If a Java Database Connectivity (JDBC) connection is closed mid-query, does the query stop?

It depends on how the query was submitted:

  • Asynchronous queries — submitted via SUBMIT JOB, INSERT INTO SELECT, or CREATE TABLE AS SELECT — continue running on the server after the JDBC connection closes.

  • All other queries are terminated when the connection closes.

If the client times out but the JDBC connection stays open, are server resources released?

Yes. Server resources are released immediately when the client times out.

Why can't I connect using the EasySwoole framework?

This issue occurs because SHOW statements are not supported in PreparedStatement.

How do I find which users or IPs are creating burst connections?

This applies to Data Warehouse Edition clusters only.
  1. Log in to the AnalyticDB for MySQL console and click the cluster ID of your Data Warehouse Edition cluster.

  2. In the left-side navigation pane, click Diagnostics and Optimization.

  3. Click the Connection Information tab to view Number of User Connections and Number of Connections to Client IP Address.

image

What is the maximum number of connections for a cluster?

There is no hard limit, but the practical maximum varies with cluster specifications. We recommend keeping the total below 50,000 connections per cluster. Low-specification clusters cannot support excessive connections due to insufficient resources. See Limits for per-specification details.