tencent cloud

Boost Engagement with Tencent RTC Free TrialFree video and chat features await!

Feedback

TDSQL-C for MySQL

Connecting Through CCN

Last updated: 2025-01-23 17:01:24
This document describes how to use Cloud Connect Network (CCN) to connect to databases.

Background

After creating a TDSQL-C for MySQL instance, if Cloud Virtual Machine (CVM) and the instance are in different Virtual Private Cloud (VPC) networks (including the same account/different accounts and the same region/different regions), you can use CCN to connect to the database. Under the same Tencent Cloud account, if you have purchased Lighthouse, since Lighthouse uses the VPC automatically assigned by Tencent Cloud for network isolation, Lighthouse cannot interconnect with TDSQL-C for MySQL in the VPC over the private network by default. Therefore, you cannot directly access TDSQL-C for MySQL through Lighthouse and need to associate with CCN to connect to the database.

Preparations

Prepare a TDSQL-C for MySQL instance as instructed in Creating Cluster (Provisioned Resources) or Creating Serverless Cluster.
Prepare a CVM instance. This document uses Lighthouse as an example. For more information, refer to Creating Linux Lighthouse Instances.

Must-Knows

The private network interconnection feature of Lighthouse is free of charge. You only need to pay attention to CCN billing information. For more information, refer to CCN Billing Overview.
Lighthouse does not support cross-border private network interconnection by associating with CCN, even if the CCN has been purchased with cross-border bandwidth.
Under the same account:
All Lighthouse instances in the same region are in the same VPC. A VPC can be associated with only one CCN instance.
Lighthouse instances in different regions are in different VPCs, which need to be associated with CCN instances separately.
If there are no Lighthouse instances in a region, you cannot associate a CCN instance in the region.

Directions

1. Log in to the Lighthouse console and select VPC interconnection on the left sidebar.
2. Select the region where your TDSQL-C for MySQL instance is located and click Associate with CCN.

3. In the pop-up Associate with CCN window, click Create CCN instance.

4. After creating a CCN instance in the pop-up window, return to the Associate with CCN page in the Lighthouse private network interconnection. The new CCN instance will be displayed after you refresh the page. Then click OK.

Note:
Only CCN instances under the same account can be associated with.
After submitting the association application, log in to the CCN console in 7 days to approve the application; otherwise, the application will expire, and you need to apply for association again.
5. Log in to the CCN console and click the target CCN ID to enter the CCN details page.

6. On the CCN details page, under Associated Instances, find the corresponding association application, click Agree in the Operation column, and then click OK in the pop-up window.
Remarks "Lighthouse VPC" will be added to the VPC instance of Lighthouse by default. Be sure to select the correct instance.
7. Click Add Instance, in the pop-up window, add the VPC network address of the target TDSQL-C for MySQL. Select a region and VPC, and then click OK.
8. Return to the VPC interconnection page in the Lighthouse console and refresh to display "Connected".

9. In the CCN console, click the target CCN ID to enter the CCN details page, and check whether routes are valid. If there are any disabled routes, enable them.

10. In the Lighthouse console, find the target Lighthouse, and log in to it.
11. After logging in successfully, run the following command to download and install MySQL. If "Complete" is displayed, the installation is successful.
yum install mysql -y

12. Run the following command to connect to TDSQL-C for MySQL.
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 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 database instance. The default account name is root.
<Private network port number>: Replace it with the private network port number of the target database instance. The default value is 3306. If it has been changed, the new private network port number can be found on the cluster details page in the TDSQL-C for MySQL console.
13. After a successful connection, the interface appears as follows.


FAQs

Are There Charges for CCN Connections?

Using CCN incurs fees. For details, see CCN Billing Instructions.

When Should I Use CCN to Connect to TDSQL-C for MySQL?

1. When CVM and TDSQL-C for MySQL instances are in different VPCs (including the same account/different accounts and the same region/different regions), you can use CCN to connect to a database.
2. If your server is Lighthouse, you will need to use CCN to connect to a database.

How Does Lighthouse Achieve Private Network Interconnection?

Lighthouse uses the VPC automatically assigned by Tencent Cloud for network isolation. By default, Lighthouse cannot interconnect with other Tencent Cloud resources in VPCs such as CVM and TencentDB over the private network, and their interconnection needs to be implemented by associating with CCN. For more information, refer to Private Network Interconnection.
Note:
Lighthouse only supports associating with CCN under the same account. Lighthouse cannot interconnect with CCN across accounts.

What Are the Service Levels for CCN?

Tencent Cloud CCN provides 3 service levels, including Platinum, Gold, and Silver.
The service level for the same region is Gold and cannot be modified.
For cross-region interconnection, Platinum, Gold, and Silver service levels are provided. You can choose the service level when creating CCN. Fees vary with service levels. You can select a service level based on your business needs. For more information, refer to Billing Overview.

How Do I Analyze and Handle a CCN Connection Failure?

Catalog

In The Article

Connecting Through CCN

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
Hong Kong, China
+852 800 906 020 (Toll Free)
United States
+1 844 606 0804 (Toll Free)
United Kingdom
+44 808 196 4551 (Toll Free)
Canada
+1 888 605 7930 (Toll Free)
Australia
+61 1300 986 386 (Toll Free)
EdgeOne hotline
+852 300 80699
More local hotlines coming soon