tencent cloud

Feedback

CCN Connection Failure

Last updated: 2025-01-23 17:01:24

Problem Description

Failed to connect to a TDSQL-C for MySQL instance via a private network address from Cloud Virtual Machine (CVM) or Lighthouse.
Note:
There are various ways to connect to TDSQL-C for MySQL, such as login through the Database Management Center (DMC) console, private network connections, public network connections, and Cloud Connect Network (CCN) connections. Different connection methods require different conditions. For example, if you need to connect to TDSQL-C for MySQL via a public network address, but you enter a private network address in the command line, the connection will fail. Similarly, if you have purchased Lighthouse but have not connected to a network through CCN, the connection will also fail when you directly use a command to connect to TDSQL-C for MySQL.
Therefore, when the connection fails, it is recommended to first refer to the connection methods and application scenarios in Connecting to Cluster > Overview to check whether the conditions are met.

Possible Causes

Possible Cause
Description
The password is incorrect.
The database account restricts access of specific host addresses.
The connection command is incorrect.
The IP address and port in the command line or configuration file are incorrect.
The routing table is not enabled.
The TDSQL-C for MySQL instance's storage space is full, the maximum number of connections has been reached, there is an issue with the timeout parameter settings, the instance is in the "availability zone switching" state, and other issues.
TDSQL-C for MySQL instance running status
The TDSQL-C for MySQL instance is isolated. You can use the recycle bin to restore it.
CVM instance status
The CVM instance is isolated or shut down. You can restore or start it in the console.
Lighthouse instance status
The Lighthouse instance is isolated or shut down. You can restore or start it in the console.

Solutions

Password Issue: The Password Is Incorrect

The password used for connection is incorrect. You can reset the password or create a temporary account with the required permissions to log in to the database.

Issue with the Host Addresses Authorized to an Account: The Database Account Restricts Access of Specific Host Addresses

In addition to security group and subnet restrictions, a database account is also restricted by the TDSQL-C for MySQL account system. If the database account specifies a particular host address, other addresses cannot connect to TDSQL-C for MySQL. You can modify the host address authorized to the database account via the TDSQL-C for MySQL console to restrict database access and enhance connection security.
1. Log in to the TDSQL-C for MySQL console and click the cluster ID in the cluster list to enter the cluster management page.
2. Select the Account Management tab, find the account for which you need to modify the host address, and choose More > Modify Host in the Operation column.
3. In the pop-up window, enter a new host address and click OK to modify the host address authorized to the account.
Note:
The host address can be an IP address or contains % (indicating no limit on the IP range). Multiple host addresses should be separated by delimiters, and the delimiters can be line breaks, spaces, and ; , |.
Example 1: Entering % indicates no limit on the IP range, allowing clients from any IP address to use this account to connect to a database.
Example 2: Entering 10.5.10.% indicates that clients with IP addresses in the range of 10.5.10.% can use this account to connect to a database.

Connection Syntax Issue: The Connection Command Is Incorrect

Check whether the connection command is incorrect. Refer to the standard public network connection command:
mysql -h <Private IP address> -u <Username, default root> -P <Port number, default 3306> -p
<Private IP address>: Replace it with the private IP address of the target TDSQL-C for MySQL database instance, which can be found on the cluster details page in the TDSQL-C for MySQL console.
<Username, default root>: Replace it with the account name of the target TDSQL-C for MySQL database instance. The default account name is root.
<Port number, default 3306>: Replace it with the private network port number of the target TDSQL-C for MySQL database instance. The default value is 3306. If it has been changed, use the new port number.

Issue with IP Addresses and Ports: The IP Address and Port in the Command Line or Configuration File Are Incorrect

When connecting to a database via commands, check whether the instance's private IP address and port number are correct, which can be found on the cluster details page in the TDSQL-C for MySQL console.


CCN Routing Issue: The Routing Table Is Not Enabled

Before connecting to a database via CCN, you need to associate Lighthouse with a CCN instance for private network interconnection. Then, add a Virtual Private Cloud (VPC) network address of the target TDSQL-C for MySQL under the CCN instance. If the route to the VPC IP range of the target TDSQL-C for MySQL is not enabled in the CCN instance's routing table, the connection will fail. Enable the corresponding route and reconnect.


TDSQL-C for MySQL Instance Issue: The TDSQL-C for MySQL Instance's Storage Space Is Full, the Maximum Number of Connections Has Been Reached, There Is an Issue with the Timeout Parameter Settings, and Other Issues

If the storage space of a TDSQL-C for MySQL instance is full, it may affect the connection to a database. It is recommended to expand the storage space. For the procedure, refer to Adjusting Storage Space.
When the message "ERROR 1040(00000): Too many connections" appears, it means the current number of connections of a cloud database instance has exceeded the limit. Common causes and solutions are as follows: i. There are many sleep threads. It is recommended to reduce the values of the wait_timeout and interactive_timeout parameters in the console. For the procedure, refer to Setting Instance Parameters. ii. There are few sleep threads and no slow query accumulation. It is recommended to increase the value of the max_connections parameter in the console. For the procedure, refer to Setting Instance Parameters.
Check whether the instance is in the "availability zone switching" state. If the TDSQL-C for MySQL instance is in the "availability zone switching" state, the connection will fail. Wait for the switching to complete before reconnecting via commands.

Catalog

In The Article

CCN Connection Failure

Contact Us

Contact our sales team or business advisors to help your business.

Technical Support

Open a ticket if you're looking for further assistance. Our Ticket is 7x24 avaliable.

7x24 Phone Support