TDSQL-C for MySQL supports both private and public network address types. By default, it provides a private network address for you to access the instance internally. To access the instance over the public network, you can connect via a Linux or Windows CVM after enabling the public network address. Alternatively, you can access the instance by enabling the public network service through CLB. When you enable the public network service through CLB, you must configure security group rules.
This section describes how to enable the public network service through CLB and connect to the instance via MySQL Workbench.
Prerequisites
You have applied to use the real server feature. Currently, this feature is in beta testing. To experience this feature, submit a ticket for application. Note:
The scenario of enabling the public network service through CLB is applicable only when the CLB instance and the TDSQL-C for MySQL instance belong to the same VPC network. It is not currently supported if they are in different VPC networks.
Step 1: Purchasing a New CLB
Note:
If you already have a load balancer instance in the same region as your TDSQL-C for MySQL instance, you do not need to purchase a new one.
Attention:
Select the region where your TDSQL-C for MySQL instance is located.
Step 2: Configuring a CLB
Scenario: CLB Instance and TDSQL-C for MySQL Instance Are in the Same VPC
1. Enable cross-VPC access (CLB supports binding to other private IP addresses after it is enabled).
1.1 Log in to the CLB console, select a region, click the instance ID in the instance management list, and go to the instance management page. 1.2 On the Basic Information page, at Backend Service, click Configure.
1.3 In the pop-up dialog box, click Submit to enable it.
2. Configure the public network listening port.
2.1 Log in to the CLB console, select a region, click the instance ID in the instance management list, and go to the instance management page. 2.2 On the instance management page, select the Listener Management page, and click New under TCP/UDP/TCP SSL Listener.
2.3 In the pop-up dialog box, complete the settings step by step, and then click Submit to complete the creation.
Step 3: Binding the Private IP Address of the TDSQL-C for MySQL Instance
1. After creating the listener, on the Listener Management page, click the created listener, and then click Bind that appears on the right.
2. In the pop-up dialog box, select Other Private IP Address as the target type, enter the IP address and port of the TDSQL-C for MySQL instance, and click Confirm to complete the binding.
Attention:
The logged-in account should be a standard account (bandwidth migrated). If it cannot be bound, Submit a Ticket for assistance. Step 4: Configuring a Security Group
1. Log in to the TDSQL-C for MySQL console and click the target cluster in the cluster list on the left to enter the cluster management page. 2. On the cluster management page, select the Security Group page, and then select the target connection object under the cluster. For example, to connect to a read-write instance under the cluster, select the read-write instance. To connect to a read-only instance under the cluster, select the read-only instance.
3. Click Configure Security Group, configure the security group rule to allow all ports, and confirm that the security group permits access from external IPs. For detailed configuration methods, see Configure Security Group. Step 5: Connecting to the Instance via MySQL Workbench
1. Install MySQL Workbench. For the official download address, see the MySQL Workbench download page. 2. After going to the download page, click MySQL Workbench.
3. After navigating to the page, click Downloads after Windows (x86, 64-bit), MSI Installer.
4. Click No thanks, just start my download.
5. After the installation is complete, open MySQL Workbench. Then, click the plus sign after MySQL Connections to add the information of the instance to be connected.
6. In the pop-up window, complete the following configurations and then click ok.
|
Connection name | Name this connection. |
Connection Method | Select Standard (TCP/IP). |
Hostname | Enter the address of the CLB instance. The VIP information can be found under the Basic Information section on the CLB instance details page. |
Port | Enter the port of the CLB instance. The TCP port number can be found under the CLB instance details page > Monitor Management. |
Username | Enter the username of the TDSQL-C for MySQL instance to be connected. The account is created on the Cluster Management page > Account Management. |
Store in Keychain | Click Store in Keychain, enter the password corresponding to the Username you filled in the pop-up window, and then click OK. |
7. Return to the MySQL Workbench home page, and click the newly created instance information to connect to the instance.
8. The interface after a successful connection is shown below.