tencent cloud

TencentDB for MySQL

Setting Database Proxy Connection Addresses

Download
Focus Mode
Font Size
Last updated: 2026-06-22 10:02:53
AI-Translated
This document introduces how to set up the database proxy connection address through the TencentDB for MySQL console.
The database proxy connection address is independent of the original database connection address. All requests through the database proxy address are forwarded through the proxy cluster to access the primary/secondary nodes of the database, perform read-write separation, forward read requests to read-only instances, and reduce the load on the primary database. TencentDB for MySQL provides a database proxy connection address by default after the database proxy is enabled. You can also add additional database proxy connection addresses, modify database proxy connection addresses, or delete database proxy connection addresses.

Prerequisites

Modify Database Proxy Connection Address

1. Log in to the TencentDB for MySQL console. In the instance list, select the primary instance for which the database proxy is enabled, and click Instance ID or Manage in the Operation column to go to the instance management page.
2. On the instance management page, select the Database Proxy tab. After the Private Network Access Address corresponding to the Connection Address, click the

icon.

3. In the pop-up dialog box, modify the proxy address and click OK.
Note:
Modifying the private network address will affect the database services that are being accessed. It is recommended that you modify it during off-peak hours. Please ensure that your business has a reconnection mechanism.


Add New Database Proxy Connection Address

Note:
The maximum number of database proxy connection addresses is 7.
A connection address is created by default when a database proxy is enabled.
1. Log in to the TencentDB for MySQL console. In the instance list, select the primary instance for which the database proxy is enabled, and click Instance ID or Manage in the Operation column to go to the instance management page.
2. On the instance management page, select the Database Proxy tab, and click Add Access Address after the Connection Address.
3. In the New Connection window, complete the following configurations and click OK. Step 1: Network Configuration
Parameter
Description
VPC
Select the network for the database proxy. Only VPC is supported. If you access the instance through a CVM, select the same VPC as the CVM.
Subnet
Select a subnet. The selection range is limited to the subnets that exist under the selected VPC.
Security Group
The default security group is the same as that of the primary instance. You can also select an existing security group or create one as needed. Multiple security groups can be selected.
Note:
To access the database proxy, you need to configure the security policy to open the private network access port (current private network port: 3306). For details, see MySQL Security Group Configuration.
Remarks
Optional. Leave remarks for the database proxy connection address to be added.
Step 2: Configuration Policy
The read/write attribute for a new connection supports read/write splitting or read-only. The configuration options vary depending on the selected read/write attribute. See the following instructions and configure accordingly based on your actual requirements.
Read/Write Splitting
Read-Only
Parameter
Description
Read/Write Attribute
Select the read-write attribute for this proxy access address. Here, select Read/Write Attribute.
Access Mode
Supports two access modes, Balanced allocation and Nearby Access, to set up the connection link from the client to the database proxy. For details, see Access Mode.
Remove Delayed RO Instances
Set the delayed read-only instance removal policy. When this feature is enabled, you can set the Delay Threshold and Least RO Instances. Whether this feature is enabled or not, the system will attempt to remove and recover read-only instances when they fail.
Delay Threshold: Enter an integer greater than or equal to 1. The unit is seconds.
Least RO Instances: This number is related to the number of read-only instances owned by the primary instance. When set to 0, after all read-only nodes are removed, all traffic is forwarded to the primary instance until the read-only instances are re-added.
Adaptive Load Balancing
Choose whether to enable the adaptive load balancing feature. Once it is enabled, requests can be routed to instances with lower load based on backend load conditions to achieve database instance load balancing. For details, see Adaptive Load Balancing.
Connection Pool Status
The connection pool feature is mainly used to reduce the instance load caused by the frequent establishment of new connections in non-persistent connection services. If you enable this feature, you can select a supported connection pool type. Currently, Session-Level Connection Pool and Transaction-Level Connection Pool are supported (database proxy version 1.4.1 or above).
Transaction Split
You can set whether to enable this feature. Once enabled, read requests before the first write request in a transaction can be forwarded to read-only instances to reduce the load on the primary instance.
Assign Read Weight
Supports selecting Assigned by system or Custom. If multiple AZs are configured when the database proxy is enabled, it supports configuring the weights separately for accessing the database through proxy nodes in different AZs.
Note:
The weight here is for read requests (non-transactional).
Unified Weight Management
If the current primary instance has a read-only analysis engine, this feature is supported. Once enabled, the read-only analysis engine can accept query statements forwarded by the proxy in scenarios without hints.
Failover
Determine whether to enable this feature. Once it is enabled, the connection address will be routed to the primary instance when the database proxy encounters faults.
Forwarding Upon Analysis Engine Faults
You can set whether to enable this feature. Once enabled, when the accessed read-only analysis engine fails, requests will be automatically forwarded to other read-only analysis engines based on rules. For detailed fault forwarding policies, see Forwarding Upon Instance Faults.
Auto Add Read-Only Instances
Determine whether to enable this feature. Once it is enabled, newly purchased read-only instances will be automatically added to the database proxy.
If the read weight is automatically assigned by the system, a weight is assigned to newly purchased read-only instances according to the specification.
If the read weight is customized, the weight of newly purchased read-only instances is 0 by default when they are added. You can click Adjust Configuration on the Database Proxy > Connection Address page to modify the weight.
Parameter
Description
Read/Write Attribute
Select the read/write attribute for this proxy access address. Here, select Read-Only.
Network Forwarding
Set whether to enable network forwarding. Once enabled, SQL distribution is performed through network forwarding. Instances with two-node, three-node, or cloud disk architectures support the network forwarding mode. For details, see Network Forwarding Feature.
Access Mode
Supports two access modes, Balanced allocation and Nearby Access, to set up the connection link from the client to the database proxy. For details, see Access Mode.
Remove Delayed RO Instances
Set the delayed read-only instance removal policy. When this feature is enabled, you can set the Delay Threshold and Least RO Instances. Whether this feature is enabled or not, the system will attempt to remove and recover read-only instances when they fail.
Delay Threshold: Enter an integer greater than or equal to 1. The unit is seconds.
Least RO Instances: This number is related to the number of read-only instances owned by the primary instance. When set to 0, after all read-only nodes are removed, all traffic is forwarded to the primary instance until the read-only instances are re-added.
Adaptive Load Balancing
Choose whether to enable the adaptive load balancing feature. This feature can be enabled only when network forwarding is not enabled. Once enabled, requests can be routed to instances with lower load based on backend load conditions to achieve database instance load balancing. For details, see Adaptive Load Balancing Feature.
Connection Pool Status
The connection pool feature is mainly used to reduce the instance load caused by the frequent establishment of new connections in non-persistent connection services. This feature can be enabled only when network forwarding is not enabled. Once enabled, you can select a supported connection pool type. Currently, Session-Level Connection Pool and Transaction-Level Connection Pool are supported (database proxy version 1.4.1 or above).
Transaction Split
Set whether to enable this feature. This feature can be enabled only when network forwarding is not enabled. Once enabled, read requests before the first write request in a transaction can be forwarded to read-only instances to reduce the load on the primary instance.
Assign Read Weight
Supports selecting Assigned by system or Custom. If multiple AZs are configured when the database proxy is enabled, it supports configuring the weights separately for accessing the database through proxy nodes in different AZs.
Note:
The weight here is for read requests (non-transactional).
Unified Weight Management
If the current primary instance has a read-only analysis engine, this feature is supported. Once enabled, the read-only analysis engine can accept query statements forwarded by the proxy in scenarios without hints.
Forwarding Upon Analysis Engine Faults
You can set whether to enable this feature. Once enabled, when the accessed read-only analysis engine fails, requests will be automatically forwarded to other read-only analysis engines based on rules. For detailed fault forwarding policies, see Forwarding Upon Instance Faults.
Apply to Newly Added RO Instances
Determine whether to enable this feature. This feature can be enabled only when network forwarding is not enabled. Once enabled, if you purchase a new read-only instance, it will be automatically added to the database proxy.
If the read weight is automatically assigned by the system, a weight is assigned to newly purchased read-only instances according to the specification.
If the read weight is customized, the weight of newly purchased read-only instances is 0 by default when they are added. You can click Adjust Configuration on the Database Proxy > Connection Address page to modify the weight.

Delete Database Proxy Connection Address

Note:
When there are multiple proxy connection addresses under the database proxy, you can delete unnecessary connection addresses, but the last address cannot be deleted.
1. Log in to the TencentDB for MySQL console. In the instance list, select the primary instance for which the database proxy is enabled, and click Instance ID or Manage in the Operation column to go to the instance management page.
2. On the instance management page, select the Database Proxy tab, locate the target address under Connection Address, and click Close.

3. In the pop-up dialog box, click OK.

Help and Support

Was this page helpful?

Help us improve! Rate your documentation experience in 5 mins.

Feedback