TencentDB for MySQL

TencentDB for MySQL
Operation Guide
Product Documentation©2013-2022 Tencent Cloud. All rights reserved.

Page 1 of 461

TencentDB for MySQL

Copyright Notice©2013-2024 Tencent Cloud. All rights reserved.
Copyright in this document is exclusively owned by Tencent Cloud. You must not reproduce, modify, copy or distributein any way, in whole or in part, the contents of this document without Tencent Cloud's the prior written consent.
Trademark Notice

All trademarks associated with Tencent Cloud and its services are owned by Tencent Cloud Computing (Beijing)
Company Limited and its affiliated companies. Trademarks of third parties referred to in this document are owned bytheir respective proprietors.
Service Statement
This document is intended to provide users with general information about Tencent Cloud's products and services
only and does not form part of Tencent Cloud's terms and conditions. Tencent Cloud's products or services are
subject to change. Specific products and services and the standards applicable to them are exclusively provided for in
Tencent Cloud's applicable terms and conditions.

©2013-2022 Tencent Cloud. All rights reserved.

Page 2 of 461

TencentDB for MySQL

Contents
Operation Guide
Use Limits
Operation Overview
Instance Management and MaintenanceViewing instance health status
Setting Instance Maintenance Time
Assigning Instance to Project
Adjusting Database Instance Specifications
Change the Port Number
Migrating AZ
Primary/Replica Switch
Terminating Instance
Instance UpgradeUpgrading the database version of MySQL 5.5 and MySQL 5.6
Upgrading from MySQL 5.7 to MySQL 8.0
Upgrading Kernel Minor Version
Upgrading Two-Node Instances to Three-Node Instances
CPU Elastic Expansion
Overview
Overview
Configuring auto scale-out
Establishing Manual Scaling
Activating Event Alarm
Performance Manifestation
Billing Overview
FAQs
Read-Only/Disaster Recovery Instances
Creating Read-Only InstanceManaging the RO Group of Read-Only InstanceManaging Delayed Replication of Read-Only InstanceManaging Disaster Recovery Instance
Database Proxy
Overview
Overview
Database Proxy Overview©2013-2022 Tencent Cloud. All rights reserved.

Page 3 of 461

TencentDB for MySQL

Use Limits
Database Proxy Kernel Features
Kernel Minor Version Release Notes
Upgrading Kernel Minor Version of Database Proxy
Database Proxy Management
Enabling Database Proxy
Setting Database Proxy Access Address
Viewing and Modifying Access Policy
Adjusting Database Proxy Configuration
Switching Database Proxy Network
Viewing Database Proxy Monitoring Data
Load Rebalancing
Disabling Database Proxy
Transaction Split Feature
Momentary Disconnection Prevention Feature
Automatic Read/Write Separation Feature
Automatic Read/Write Separation Overview
Configuring Database Proxy Read-Write Attributes
Connection Pool Feature
Connection Pool Overview
Enabling and Disabling the Connection Pool Feature
Other Features
Hint Syntax Usage
Account Management
Creating Account
Setting Password Complexity
Resetting Password
Modifying Account Permissions
Modifying Host Addresses with Access Permissions
Deleting AccountDatabase Management Center (DMC)DMC Overview
DMC Management
Parameter Configuration
Setting Instance Parameters
Managing Parameter Template
Comparison of Different Template Parameters
Performance Comparison of Parameter Templates©2013-2022 Tencent Cloud. All rights reserved.

Page 4 of 461

TencentDB for MySQL

Suggestions on Parameter Configuration
Intelligent Parameter Tuning
Modification Records of System Parameter Templates
Network and Security
Access Management
Overview
Authorization Policy Syntax
Authorizable Resource Types
Console Examples
TencentDB Security Group Management
Enabling Public Network Address
Network Switch
Enabling Public Network Access Through CLB
Enabling Transparent Data Encryption
Setting SSL Encryption
Backup and Rollback
Backing up Databases
Configuring Transition-to-Cold Storage
Cross-Region Backup
Backup Encryption
Setting Backup Download Rules
Viewing Backup Space
Configuring Local Binlog Retention Policy
Restoring Database from Backup File
Restoring Database from Physical Backup
Restoring Database from Logical Backup
Downloading Backups
Rolling back Databases
Deleting Backups
Cloning Instances
Data Migration
Migrating with DTS
Importing SQL Files
Migrating Data Offline
Monitoring and Alarms
Monitoring
Alarm Policies (TCOP)
Alarm Notification (DBbrain)©2013-2022 Tencent Cloud. All rights reserved.

Page 5 of 461

TencentDB for MySQL

Setting Event Alarms
Operation Logs
Operation Logs
Log Delivery
Tag
Overview
Editing Tags

©2013-2022 Tencent Cloud. All rights reserved.

Page 6 of 461

TencentDB for MySQL

Operation Guide
Use Limits：

Last updated 2024-07-22 14:31:43

Limits on the Data Volume
TencentDB for MySQL imposes data volume restrictions on all types of MySQL instances to isolate performanceissues due to limited resources. This document describes the technical impact of a single instance or table with alarge data volume on MySQL.
Instance with a high data volume: The default storage engine for TencentDB is InnoDB. If the cache buffer cancache all data and index pages in the MySQL instance, the instance can support a large number of concurrent accessrequests. If the instance contains too much data, the cache and buffer will frequently swap data in/out, quickly hitting
an IO bottleneck and reducing throughput. For example, if a TencentDB instance is designed to sustain up to 8,000
access requests per second, it can only support 700 when the data volume is twice the size of the cache and buffer.
Table with a high data volume: If a table contains too much data, MySQL will find it more difficult to manage table
resources (data, indexes, etc.), reducing table processing efficiency. For example, if the size of a transaction table(InnoDB) exceeds 10 GB, the latency in update operations will soar, increasing the response time for transactions. In
this case, the problem can only be solved through sharding and migration.
Note:
If the number of tables in a single instance exceeds one million, backup, monitoring, and upgrade may fail anddatabase monitoring may be affected. Make sure that the number of tables in a single instance is below one million.

Limit on the Number of Connections
The maximum number of connections to a MySQL instance is specified with the MySQL system variable
max_connections . When the actual number exceeds max_connections , no more connections can beestablished.
The default number of connections to TencentDB can be viewed by clicking the instance ID to enter the Database
Management > Parameter Settings page in the TencentDB for MySQL console, which can be adjusted if
necessary. However, more connections mean that more system resources will be consumed; if the number ofconnections goes beyond what the actual system load capacity allows, the system service quality will be definitely
undermined.
For more information on max_connections , see MySQL official documentation.

©2013-2022 Tencent Cloud. All rights reserved.

Page 7 of 461

TencentDB for MySQL

Limits on the MySQL Client Version
We recommend that you use the MySQL client and library that come with CVM to connect to TencentDB instances.

Notes on slow logs
For Linux CVM instances, you can use TencentDB's export tool to get slow query logs. For more information, see
Restoring Database from Physical Backup.
For Windows CVM instances, slow query logs cannot be obtained directly at present. If you need them, submit a ticket
for assistance.

Notes on the TencentDB binlog retention duration
TencentDB for MySQL binlogs can be retained for 7 (default value) to 1830 days (customizable by clicking the
instance ID to enter the Backup and Restoration > Auto-Backup Settings page).
If binlogs are retained for an extended period of time or grow too fast, additional space will be required for backup, andfees will be incurred if the space exceeds the free tier of backup capacity.

Notes on the character set
TencentDB for MySQL uses the UTF8 character set by default.
Even though TencentDB supports changing the default character set, we recommend that you explicitly specify theencoding format for a table when creating it and specify the connection encoding during connection establishment. In
this way, your application will be more portable.
For more information on the resources of MySQL character set, see MySQL official documentation.
You can modify the character set through SQL or in the TencentDB for MySQL console.
Modifying the character set through SQL
1. Run the following SQL statements to change the default character set for TencentDB instances:©2013-2022 Tencent Cloud. All rights reserved.

Page 8 of 461

TencentDB for MySQLSET @@global.character_set_client = utf8;
SET @@global.character_set_results = utf8;
SET @@global.character_set_connection = utf8;
SET @@global.character_set_server = utf8;
After the statements are executed, @@global.character_set_server will be automatically synced to a local
file for persistence in approximately 10 minutes, while the other 3 variables will not. The configured value will stayunchanged even after migration or restart.
2. Run the following statements to change the character set encoding for the current connection:©2013-2022 Tencent Cloud. All rights reserved.

Page 9 of 461

TencentDB for MySQLSET @@session.character_set_client = utf8;
SET @@session.character_set_results = utf8;
SET @@session.character_set_connection = utf8;
Or©2013-2022 Tencent Cloud. All rights reserved.

Page 10 of 461

TencentDB for MySQLSET names utf8;
3. For PHP programs, you can configure the character set encoding for the current connection by using the following
function:©2013-2022 Tencent Cloud. All rights reserved.

Page 11 of 461

TencentDB for MySQL

bool mysqli::set_charset(string charset);Or©2013-2022 Tencent Cloud. All rights reserved.

Page 12 of 461

TencentDB for MySQL

bool mysqli_set_charset(mysqli link, string charset);
4. For Java programs, you can configure the character set encoding for the current connection as shown below:©2013-2022 Tencent Cloud. All rights reserved.

Page 13 of 461

TencentDB for MySQL

jdbc:mysql://localhost:3306/dbname?useUnicode=true&characterEncoding=UTF-8

Modifying the character set in the TencentDB for MySQL console
1. Log in to the TencentDB for MySQL console and click an instance ID in the instance list to enter the instance details
page.
2. Find the character set in Basic Info and click the modification icon to modify it.

©2013-2022 Tencent Cloud. All rights reserved.

Page 14 of 461

TencentDB for MySQL

3. In the pop-up window, select a character set and click OK.

Limits on operations
1. Do not modify the information and permissions of the existing accounts for a MySQL instance; otherwise, somecluster services may become unavailable.
2. InnoDB is recommended for creating databases and tables, so that the instances can better support a large numberof concurrent access requests.
3. Do not modify or terminate the source-replica relationship; otherwise, hot backup may fail.

Limits on the table name
Chinese table names are not supported because they may result in failures of processes such as rollback andupgrade.

©2013-2022 Tencent Cloud. All rights reserved.

Page 15 of 461

TencentDB for MySQL

Database Account Permission
TencentDB for MySQL no longer provides the super user permission. To modify parameters that require thispermission, log in to the TencentDB for MySQL console, click the instance ID to enter the Database Management >Parameter Settings page, and modify them.

Network Selection
We recommend that you use a VPC. In the VPC, you can freely define IP range segmentation, IP addresses, androuting policies. Compared with the classic network, VPC is more suitable for scenarios where custom network
configurations are required. For the comparison of VPC and classic network, see Overview.

©2013-2022 Tencent Cloud. All rights reserved.

Page 16 of 461

TencentDB for MySQL

Operation Overview：

Last updated 2024-07-30 14:53:43
This document describes operations on the instance list and management pages in the TencentDB for MySQL
console.

Instance list page
You can log in to the TencentDB for MySQL console and enter the instance list page to view instance information andmanage your instances.

FeatureDescription

Login

In the instance list, click Log In in the Operation column to log in to the database byusing the new-gen database tool. For more information, see DMC Overview.

Management

In the instance list, click Manage in the Operation column to enter the instancemanagement page.

Version upgrade

In the instance list, click More > Upgrade Version in the Operation column to upgrade
the database version. For detailed conditions and instructions, see Upgrading Database
Engine.

Configuration
adjustment

In the instance list, click More > Adjust Configurations in the Operation column toadjust the configuration (i.e., scaling) of your database instance. Both instance upgradeand downgrade are supported. For more information, see Adjusting Database InstanceSpecification.

Pay-as-you-go tomonthly
subscriptionchangeIn the instance list, click More > Pay-as-You-Go to Monthly Subscription in the
Operation column to change the billing mode of the pay-as-you-go instance.

©2013-2022 Tencent Cloud. All rights reserved.

Page 17 of 461

TencentDB for MySQLTag editing

In the instance list, click More > Edit Tag in the Operation column to edit and manage
the tags of the instance. For more information, see Editing Tags.

Termination/Return

In the instance list, click More > Terminate/Return in the Operation column to returnthe instance. For more information, see Terminating Instance.
In the instance list, click More > Security Group in the Operation column to configure

Security groupor modify the security group of the instance. For more information, see TencentDB
Security Group Management.

Renewal

Select the target instance and click Renew above the instance list to set manual renewal
for the instance. For more information, see Renewal.
Select one or more target instances and click Restart above the instance list to restartthem.
The instance will be inaccessible during the restart, and existing connections to it will beclosed.

RestartIf the number of business writes and the number of dirty pages is high during the restart,
the restart will fail. In this case, the instance will go back to the state before the restartand become accessible.
Restart the instance during off-peak hours to ensure success and minimize the impact on
your business.
Select the target instance and click More > Rollback above the instance list to roll it

RollbackParameter
configurationback to a specified time point based on cold backup and binlog. For more information,
see Rolling Back Databases.
Select one or more target instances and click More > Parameter Settings above theinstance list to modify their parameter values. For more information, see Setting InstanceParameters.

Auto-renewal

Select one or more target instances and click More > Enable Auto-Renewal above theconfiguration

instance list to set monthly auto-renewal for them. For more information, see Renewal.

Instance management pageLog in to the TencentDB for MySQL console, click the target instance ID in the instance list, or click Manage in the
Operation column to enter the instance management page, where you can view its details, monitor it, and manage
databases.

©2013-2022 Tencent Cloud. All rights reserved.

Page 18 of 461

TencentDB for MySQL

FeatureDescription
On the Instance Details tab, you can view and manipulate various information of thedatabase. Click

Instance
details
to modify the basic information of the instance, where the public network address is disabled
by default. If needed, click Enable after Public Network Address to enable it.
Instance
monitoring

On the Instance Monitoring tab, you can view the monitoring data of various core metrics ofthe current database in various dimensions such as access, load, query cache, table, InnoDB,
and MyISAM. For more information, see Monitoring and Alarm Policies (Cloud Monitor).

Database

Database List

management

On this tab, you can import SQL files into a specified database. For more information, see
Importing SQL Files.
Parameter Settings
On this tab, you can set and view the history of customizable database parameters. Clickin the Current Value column to modify the parameter value. For more information, seeManaging Parameter Templates.
Manage Account©2013-2022 Tencent Cloud. All rights reserved.

Page 19 of 461

TencentDB for MySQLOn this tab, you can manage the system's default root account, such as modifying permissions
and resetting password. You can also create and delete accounts or enable the password
complexity feature to enhance the database access security. For more information, see AccountManagement and Setting Password Complexity.
SecurityOn the Security Group tab, you can configure security groups for your databases. For more

group

information, see TencentDB Security Group Management.

Backup andrestoration

On the Backup and Restore tab, you can download binlogs, perform cold backup, setautomatic, manual, and cross-region backups, and enable backup encryption. For more
information, see Backing up Databases, Cross-Region Backup, and Backup Encryption.

Operationlog

On the Operation Log tab, you can view and download slow query logs, error logs, androllback logs. For more information, see Operation Logs.
Create one or more read-only instances to support read/write separation and one-primary-Read-only
instance

multiple-secondary application scenarios.
For operations on two-node or three-node instances, see Creating Read-Only Instance.
Cluster Edition instances support creating 1 to 5 read-only nodes. For operations, see Adding a
Node for an Instance.
Additionally, the Cluster Edition instances support creating 1 to 15 independent read-only
instances. For operations, see Creating Read-Only Instance.

Databaseproxy

It is used to proxy requests when the application service accesses the database. It provides
advanced features such as automatic read/write separation, connection pool, and connection
persistence and boasts high availability, high performance, Ops support, and ease of use. For
more information, see Database Proxy Overview.

Data security

On the Data Security tab, you can enable TDE for the instance, but then the instance cannot
be restored from a physical backup to a self-created database on another server. You can alsoenable SSL encryption to transfer data in an encrypted manner and prevent it from being
intercepted, tampered with, or eavesdropped. For more information, see Enabling Transparent
Data Encryption and Setting SSL Encryption.

Connectioncheck

On the Connection Check tab, you can check for potential connectivity and access problems
and address them by using the solutions provided so as to ensure that your databases can beaccessed normally. For more information, see One-Click Connectivity Checker.

©2013-2022 Tencent Cloud. All rights reserved.

Page 20 of 461

TencentDB for MySQL

Instance Management and MaintenanceViewing instance health status：

Last updated 2023-12-27 10:15:26
The MySQL Instance Details page now displays the health status, exception alarms, and configurations related toavailability, performance, and security of the instance. This helps users detect anomalies in a timely manner, so thatthey can optimize system performance and security configurations, and improve the security and stability of instances.
This section describes how to view the health status of the instance and related operations on the Instance Details
page.

Prerequisites
You have created a MySQL instance..

Viewing Instance Health Status
1. Log in to the TencentDB for MySQL console..
2. In the instance list, click an instance ID or Manage in the Operation column to enter the instance details page.
3. On the right side of the page, you can view the health status of the instance, including the health status score,
exception alarm items, and functional configuration deployment status.

Related Operations©2013-2022 Tencent Cloud. All rights reserved.

Page 21 of 461

TencentDB for MySQL

Page

Operation
One-Click Connection Check

Instance Details
Page

One-Click Diagnosis
Viewing Alarms
Viewing Configurations

1. One-Click Connection Check
If you cannot access a MySQL instance via either the private or public network, the One-Click Connection Check tool
can help to troubleshoot the connection issues. Click the Quick Connection Check following the private network
address to navigate to the connection check page. For subsequent operations, please refer to One-Click Connection
Check Tool.
2. One-Click Diagnosis****Under the instance health status, the current instance health score is displayed. With a perfect health score of 100,
you can promptly know whether the instance is running healthily. This score can be manually refreshed.
Click the Quick Check button following the score to navigate to the DBbrain console's Exception Diagnosis page.
This page offers real-time performance monitoring, health checks, failure diagnosis, and optimization suggestions forthe user's instance. It enables users to see the real-time operation status of the database instance intuitively, locate
newly emerged performance anomalies, and optimize the system based on the optimization suggestions.
For instructions on viewing monitoring information, diagnostic information, etc. on the exception diagnosis page,please refer to Exception Diagnosis.
3. Viewing Alarms
On the instance details page, the Exception Alarm section displays the exception alarms of the instance within the last
three hours. Based on the exception alarm prompts, users can acquire detailed information about risk items ofdifferent risk levels at a certain stage of the instance. This information helps users make optimizations andadjustments accordingly. The exception alarm items are collected by the Exception Diagnosis feature of DBbrain.
Click View Alarm. A sidebar is displayed, listing exception alarms of different levels associated with the current
instance.

©2013-2022 Tencent Cloud. All rights reserved.

Page 22 of 461

TencentDB for MySQL

Click Alarm Details in the top-right corner to go to the Exception Alarms page of the DBbrain console. Here you canreview details such as basic information about the alarmed instance, risk level, diagnostic items, and the duration. For
details about the information and operations on the Exception Alarms page, please refer to Exception Alarms.

4. Viewing Configurations©2013-2022 Tencent Cloud. All rights reserved.

Page 23 of 461

TencentDB for MySQLMySQL provides users with configuration details about database functionality from three perspectives: availability,
performance, and security. Users can select a category based on their actual requirements and reference thecorresponding configurations.
Click View Configuration. A sidebar is displayed, listing detailed configuration information of the databasefunctionality. As shown in the following table:
Availability (The configuration item description is shown based on the availability level.)
Single Point Failure
AZ-level Faults
Region-Level Failure
Highly-Availability Architecture Applying to All Scenarios
Configuration ItemSpace

Description
Forecasts whether theremaining space can satisfy theneeds for the forthcoming 30

Configuration Level

Operation-

Space Analysis

Enhanced
Configuration

Enable Database Proxy
View Instructions-

View Instructions-

View Instructions

Enhanced
Configuration

View Instructions

days.

Momentary
Disconnection
Prevention

Multi-AZ Deployment

Multi-AZ Deployment(Database Proxy)

Ensures application continuity
without loss during planned
detrimental database instanceswitches and transfers, thus
averting connection
interruptions.
The multi-AZ deployment
feature of MySQL provides yourdatabase instance with highavailability and failover support.
The Multi-AZ deployment
feature of MySQL databaseproxy offers multi-region failover
support for the proxy.
The three-node mode employs
the backup architecture withThree-NodeMultiple RO Instances
RO Group

one primary and two secondary
databases, supporting strong
synchronous replication method
and offering financial-gradereliability and high availability.
A single read-only instance issubject to single point failure©2013-2022 Tencent Cloud. All rights reserved.

Mandatory
Configuration

View Instructions

Page 24 of 461

TencentDB for MySQL

risks, hence, it's recommended
to keep at least two read-only
instances within a single RO
group to ensure availability.

Multi-AZ RO InstanceWithin a single RO group, RO
instances can only be deployedin one AZ. To enable cross-AZ-

View Instructions-

View Instructions-

View Instructions

deployment, you can create
multiple RO groups.
Helps users in enhancing theircross-region service continuity

Disaster Recovery
Instance

at a lower cost while
simultaneously improving datareliability.
Synchronizes backup files to

Cross-Region Backup

Configuration
Item
Space

Momentary
Disconnection
Prevention

another region, enabling users
to enhance their regulatorycompliance and disasterrecovery capabilities.

Description
Forecasts whether the remaining space can satisfy
the needs for the forthcoming 30 days.
Ensures application continuity without loss during
planned detrimental database instance switches
and transfers, thus averting connection

Configuration
Level

Operation-

Space Analysis

Enhanced
Configurationinterruptions.

Enable Database
Proxy
View Instructions

Multi-AZ
Deployment

MySQL's Multi-AZ deployment ensures highavailability and failover support for databaseinstances.

Mandatory
Configuration

View Instructions

Multi-AZ
Deployment(Database
Proxy)The Multi-AZ deployment feature of MySQL
database proxy offers multi-region failover support
for the proxy.

Mandatory
Configuration

View Instructions©2013-2022 Tencent Cloud. All rights reserved.

Page 25 of 461

TencentDB for MySQL

Three-NodeThree-node instances utilize the architecture with
one primary and two secondary databases, which

Enhanced
Configuration

View Instructions

can support a strong synchronous replicationmode, and providing finance-grade reliability andhigh availability.
Multiple RO
Instances RO
Group

Multi-AZ RO
Instance

A single read-only instance is subject to single
point failure risks, hence, it's recommended tokeep at least two read-only instances within asingle RO group to ensure availability.
Within a single RO group, RO instances can only
be deployed in one AZ. To enable cross-AZ
deployment, you can create multiple RO groups.

Disaster
RecoveryHelps users in enhancing their cross-region service
continuity at a lower cost while simultaneously

Instance

improving data reliability.

Cross-Region
BackupSynchronizes backup files to another region,
enabling users to enhance their regulatorycompliance and disaster recovery capabilities.

Configuration ItemSpace

Description
Forecasts whether theremaining space cansatisfy the needs for theforthcoming 30 days.

Mandatory
Configuration

View Instructions

Mandatory
Configuration

View Instructions-

View Instructions-

View Instructions

Configuration Level

Operation-

Space Analysis

Ensures application
Momentarycontinuity without loss
during planned

Disconnection
Prevention

detrimental databaseinstance switches andEnhanced Configuration

Enable Database Proxy
View Instructionstransfers, thus averting
connection interruptions.
MySQL's Multi-AZ
deployment ensures
Multi-AZ Deployment

high availability andfailover support for

Mandatory Configuration

View Instructions

database instances.

©2013-2022 Tencent Cloud. All rights reserved.

Page 26 of 461

TencentDB for MySQL

Multi-AZ Deployment

The Multi-AZ(Database Proxy)

deployment feature of

Mandatory Configuration

View Instructions

Enhanced Configuration

View Instructions

Mandatory Configuration

View Instructions

Mandatory Configuration

View Instructions

Mandatory Configuration

View Instructions

Enhanced Configuration

View Instructions

MySQL database proxyoffers multi-region
failover support for theproxy.
Three-node instances
utilize the architecturewith one primary andThree-Nodetwo secondary
databases, which cansupport a strong
synchronous replicationmode, and providing
finance-grade reliability
and high availability.
A single read-only
instance is subject tosingle point failure risks,

Multiple RO Instances
RO Group

hence, it's
recommended to keep atleast two read-only
instances within a single
RO group to ensure
availability.
Within a single RO
group, RO instances canMulti-AZ RO Instanceonly be deployed in one
AZ. To enable cross-AZ
deployment, you cancreate multiple RO
groups.
Helps users inenhancing their cross-

Disaster Recovery

region service continuity

Instance

at a lower cost while
simultaneously
improving data reliability.

Cross-Region Backup

Synchronizes backup
files to another region,
enabling users to©2013-2022 Tencent Cloud. All rights reserved.

Page 27 of 461

TencentDB for MySQL

enhance their regulatorycompliance and disasterrecovery capabilities.

Configuration Item

Description

Configuration Level

Operation-

Space Analysis

Forecasts whether theSpaceremaining space cansatisfy the needs for theforthcoming 30 days.
Ensures application
continuity without loss

Momentary
Disconnection

during planned
detrimental database

Prevention

instance switches andMandatory Configuration

Enable Database Proxy
View Instructionstransfers, thus averting
connection interruptions.
MySQL's Multi-AZ
deployment ensures
Multi-AZ Deployment

high availability and

Mandatory Configuration

View Instructions

Mandatory Configuration

View Instructions

Mandatory Configuration

View Instructions

failover support for
database instances.
The Multi-AZ
Multi-AZ Deployment(Database Proxy)

deployment feature of
MySQL database proxyoffers multi-region
failover support for theproxy.
Three-node instances
utilize the architecturewith one primary andtwo secondary

Three-Nodedatabases, which cansupport a strong
synchronous replicationmode, and providing
finance-grade reliability
and high availability.

©2013-2022 Tencent Cloud. All rights reserved.

Page 28 of 461

TencentDB for MySQL

Multiple RO Instances

A single read-only

RO Group

instance is subject tosingle point failure risks,

Mandatory Configuration

View Instructions

Mandatory Configuration

View Instructions

Mandatory Configuration

View Instructions

Mandatory Configuration

View Instructions

hence, it's
recommended to keep atleast two read-only
instances within a single
RO group to ensure
availability.
Within a single RO
group, RO instances canMulti-AZ RO Instanceonly be deployed in one
AZ. To enable cross-AZ
deployment, you cancreate multiple RO
groups.
Helps users inenhancing their cross-

Disaster Recovery
Instance

region service continuity
at a lower cost while
simultaneously
improving data reliability.
Synchronizes backup

Cross-Region Backup

files to another region,
enabling users toenhance their regulatorycompliance and disasterrecovery capabilities.

Performance
Configuration
Item
Parallel Query
Asynchronously
Dropping Large
TablesDescription

Operation

Harnesses multiple computing kernels, significantly reducing the responsetime for large-scale queries.

View
Instructions

The DROP TABLE operation gradually clears the original database file (.ibd)
in the background, mitigating the impact on performance.

View
Instructions©2013-2022 Tencent Cloud. All rights reserved.

Page 29 of 461

TencentDB for MySQL

Instant Column
Addition

The Instant Column Addition feature enables swift column addition to large
tables by solely modifying the data dictionary, minimizing the impact on

View
Instructions

system.
Instant Column
Modification

Read-Only
Instance

The Instant Column Modification Feature enables swift column modificationin large tables by solely modifying the data dictionary, minimizing the impact-

on system.
Creates Read-Only instances to facilitate read/write segregation andmaster-replica application scenarios, thereby enhancing the database's readload capacity.

View
Instructions

CPU Elastic

Once Auto CPU Elastic Scaling is activated, it effectively guarantees the

View

Scalingstability of online operations.

Instructions

Automatic
Read/Write

By configuring access strategies for Read/Write Separation throughdatabase proxy, you can achieve elastic expansion of reading capability,

View

Separation

thereby mitigating database pressure.

Instructions

Security
Configuration
Item

Description

Operation

Security

Security group is a type of virtual firewall that regulates the inbound andoutbound traffic at the instance level, serving as a crucial means for network

View

Group

security isolation.

Instructions

SSL

SSL authentication is the verification process from the client to the cloud
database server, which authenticates both the user and the server.

View
Instructions

Password

Configures the password complexity to enhance the robustness of the

View

Complexity

database access passwords, safeguarding the security of your database.

Instructions

Transparent
Data
Encryption(TDE)
LatencyRead-Only

TDE performs encryption and decryption operations transparently to the user,
doing so in real-time, and meets the compliance requirements for static dataencryption.
By setting delay replication and initiating the recovery to a specific time during
the delay period, efficient data rollback and rapid fault traceback can beachieved.

View
Instructions

View
Instructions

BackupEncryption

After the Backup Encryption feature is enabled, newly created physical backup
files will be automatically encrypted for storage.

View
Instructions

Download

By default, backup files can be downloaded over a public or private network.

View©2013-2022 Tencent Cloud. All rights reserved.

Page 30 of 461

TencentDB for MySQL

Restrictions

Restrictions can be implemented via the download configuration settings.

Instructions

Database

Records accesses to databases and execution of SQL statements, improving

View

Auditing

your database security level.

Instructions

on Backups©2013-2022 Tencent Cloud. All rights reserved.

Page 31 of 461

TencentDB for MySQL

Setting Instance Maintenance Time：

Last updated 2024-07-22 14:33:38

Overview
Maintenance time is a very important concept for TencentDB for MySQL. To ensure the stability of your TencentDB
for MySQL instance, the backend system performs maintenance operations on the instance during the maintenanceperiod from time to time. To minimize the potential impact on your business, we recommend that you set an
acceptable maintenance period for your business instance, usually during off-peak hours.
In addition, we also recommend you perform operations involving data migration during the maintenance time, such as
instance specification adjustment, instance version upgrade, and instance kernel upgrade. Currently, the maintenancetime can be customized for source, read-only, and disaster recovery instances.
Take the database instance specification upgrade as an example. As this operation involves data migration, after the
upgrade is completed, a momentary disconnection from the database may occur. When the upgrade is initiated, you
can select During maintenance time for Switch Time, so that the instance specification will be switched during thenext maintenance time after the instance upgrade is completed. Note that when you select During maintenancetime for Switch Time, the switch will not occur immediately after the database specification upgrade is completed;instead, the sync will continue till the instance goes into the next maintenance time when the switch will be
performed. As a result, the overall time it takes to upgrade the instance may be extended.
Note:
Before maintenance is carried out for TencentDB for MySQL, notifications will be sent to the contacts configured inyour Tencent Cloud account by SMS and email.
TencentDB for MySQL will perform a data consistency check within the maintenance time configured for the databaseinstance to ensure the source-replica data consistency and reduce the risk of data exceptions after the instanceswitch. The database performance will drop slightly during the check; therefore, we recommend that you select amaintenance time during off-peak hours. If the current load of the database is high, the check will be initiated during
the maintenance time.
Instance switch will cause a momentary disconnection from the database. Make sure that your business has areconnection mechanism.

Directions
Setting the maintenance time
1. Log in to the TencentDB for MySQL console. In the instance list, click an instance ID or Manage in the Operation
column to enter the instance details page.

©2013-2022 Tencent Cloud. All rights reserved.

Page 32 of 461

TencentDB for MySQL

2. In the Maintenance Info section on the instance details page, click Modify.

3. In the pop-up window, select Maintenance Window and Maintenance Time and click OK.

Performing the switch
If a task is configured to be switched during the maintenance time, but you need to switch it urgently under special
circumstances, you can click Switch Now in the Operation column.
Note:
Immediate switch is applicable to operations involving data migration such as instance specification adjustment,
instance version upgrade, and instance kernel upgrade.
For version upgrade, if it is associated with multiple instances, the switch will be performed in the order from disasterrecovery instance to read-only instance to source instance.

©2013-2022 Tencent Cloud. All rights reserved.

Page 33 of 461

TencentDB for MySQL

Assigning Instance to Project：

Last updated 2024-07-22 14:35:34
TencentDB for MySQL supports assigning instances to different projects for management. Notes for assignment arelisted below:
Read-only instances and disaster recovery instances are the associated instances of the source instance and should
be in the same project as the source instance.
Assigning and reassigning TencentDB instances will not affect the services provided by the instances.
You need to specify a project to which a new instance belongs when purchasing it. Default Project will be used if you
don't specify one.
Assigned instances can be reassigned to other projects through the Assign to Project feature.

Assigning the project on the purchase page
1. Log in to the TencentDB for MySQL purchase page.
2. When purchasing a new instance, you can directly specify the project to assign the instance to.

Modifying the project on the purchase page
1. Log in to the TencentDB for MySQL console. In the instance list, click an instance ID or Manage in the Operation
column to enter the instance details page.
2. Click Switch to Another Project after Basic Info > Project, select the target project in the pop-up window, andclick OK.

©2013-2022 Tencent Cloud. All rights reserved.

Page 34 of 461

TencentDB for MySQLNote:
You can also batch assign multiple instances to a project by selecting them and clicking More > Assign to Project
above the instance list.

©2013-2022 Tencent Cloud. All rights reserved.

Page 35 of 461

TencentDB for MySQL

Adjusting Database Instance Specifications：

Last updated 2024-06-20 10:40:54
TencentDB for MySQL supports flexible scaling that allows you to quickly adjust instance specification in the console.
You can do so at any time (at the start, during rapid development, or during peak/off-peak hours), so you can get themost out of your resources and reduce unnecessary costs in real time. For more information, see Instance Adjustment
Fee.
In cluster edition instances, the adjustment configuration operation also allows for adding or deleting read-only nodes,change of node availability zones, etc. Please see Adjust Instance Configuration.

Instance Disk Space Description
To ensure business continuity, upgrade your instance specifications or purchase additional disk capacity in time
before disk capacity is used up.
Note:
You can view disk space on the instance details page in the MySQL console, or receive disk alarms by configuring[Alarm Policies (TCOP)(https://www.tencentcloud.com/document/product/236/8457).
When the size of the data stored on an instance exceeds its capacity limit, the instance will be locked and become
read-only. You will not be able to write data to it. You will need to expand its capacity or delete some database tablesin the console to unlock it.
To avoid the database from triggering the lock status repeatedly, a locked instance will be unlocked and allowed forreads and writes only when its remaining available capacity is more than 20% of its total capacity or over 50 GB.

Configuration Adjustment Description
By default, the instance configuration is adjusted in the normal mode, which requires a data migration for the
adjustment to complete after you adjust the instance configuration in the console. But if the physical machine where
the instance is located has sufficient remaining resources (aka local resources), you can choose the QuickChange
mode. The adjustment process is as follows:©2013-2022 Tencent Cloud. All rights reserved.

Page 36 of 461

TencentDB for MySQL

Normal mode: to adjust the instance configuration, instance data needs to be migrated from the original physicalmachine to a new one. Because adjustment in this mode requires data migration, comparison, and verification, theoverall adjustment process will take a long time in case of a huge amount of data. Besides, an instance switch may
occur after the adjustment is completed.
QuickChange mode: the instance configuration can be adjusted without migrating data or switching to anotherphysical machine. As no migration preparation is needed, the overall adjustment process is much shorter.
Note:
The ability to trigger a rapid configuration change during instance configuration change is closely related to theresource availability of the host machine. Please take the activation status of the rapid configuration change switch on
the actual configuration adjustment page as the criterion.
If the Rapid Allocation Switch is activated, it means that the current host resources are sufficient to support rapid
configuration changes.

If the rapid configuration change switch is not activated, it means that the host machine lacks sufficient resources toperform rapid configuration change.

When local remaining resources are sufficient to meet the conditions for rapid configuration change, the rapid
configuration change will be used by default. If not to use it, turn it off on the Configuration Adjustment page. (i.e. you
can choose to enable or disable the "Rapid Configuration Change" button on the Configuration Adjustment Page).

©2013-2022 Tencent Cloud. All rights reserved.

Page 37 of 461

TencentDB for MySQL

Use Limits
A read-only instance with an exclusive VIP enabled does not support QuickChange.
If a read-only instance group (RO group) enables the "Remove Delayed RO Instances" feature, read-only instances
whose delay exceeds the specified threshold will be removed from the RO group until the number of remaining ones
reaches the allowed minimum number. If the number of the remaining available read-only instances in an RO group isless than or equal to the allowed minimum number, none of those instances will support QuickChange.
If an RO group only has one read-only instance, the instance does not support QuickChange.
When upgrading a minor version, whether a restart is involved, the prompts on the configuration change page shallprevail.

Configuration Adjustment Rules
You can adjust the configuration of a TencentDB for MySQL instance and its associated read-only and disasterrecovery instances only when they are in normal status (running) and are not executing any task.
You cannot cancel a configuration adjustment operation in progress.
The name, access IP, and access port of the instance remain unchanged after configuration adjustment.
During configuration adjustment, you should try to avoid such operations as modifying MySQL's global parameters
and user password.
Data migration may be involved in configuration adjustment. During data migration, the TencentDB for MySQL
instance can be accessed normally and the business will not be affected.
Instance switchover may be needed after configuration adjustment is completed (i.e., the MySQL instance may bedisconnected for seconds). It is recommended that applications be configured with auto reconnection feature and that
instance switchover be conducted during the instance maintenance period. For more information, see Setting Instance
Maintenance Window.
Basic single-node TencentDB for MySQL instances are unavailable for about 15 minutes in the process ofconfiguration adjustment. We recommend you adjust instance configuration during off-peak hours.

Instance Specification and Storage Table
Two-node/Three-node (local SSD disk)
Isolation Policy

CPU and Memory

Maximum IOPS

Storage Space

General1-core 1000 MB

1200

25GB - 3000GB

1-core 2000 MB

2000©2013-2022 Tencent Cloud. All rights reserved.

Page 38 of 461

TencentDB for MySQL

2-core 4000 MB

4000

4-core 8000 MB

8000

4-core 16000 MB

14000

8-core 16000 MB

20000

8-core 32000 MB

28000
25GB - 4000GB

16-core 32000 MB

32000

16-core 64000 MB

40000

16-core 96000 MB

40000

16-core 128000 MB

40000

25GB - 8000GB

24-core 192000 MB

60000

25GB - 6000GB

24-core 244000 MB

60000
25GB - 8000GB

32-core 256000 MB

80000

48-core 488000 MB

12000025GB - 12000GB

Dedicated

80-core 690000 MB

1400002-core 16000 MB

8000

4-core 16000 MB

10000

4-core 24000 MB

13000

4-core 32000 MB

16000

8-core 32000 MB

32000

8-core 48000 MB

36000

8-core 64000 MB

40000

12-core 48000 MB

36000

12-core 72000 MB

40000

12-core 96000 MB

48000

16-core 64000 MB

60000©2013-2022 Tencent Cloud. All rights reserved.

25GB - 4000GB

25GB - 8000GB

Page 39 of 461

TencentDB for MySQL

16-core 96000 MB

60000

16-core 128000 MB

60000

24-core 96000 MB

72000

24-core 144000 MB

76000

24-core 192000 MB

80000

32-core 128000 MB

80000

32-core 192000 MB

90000

32-core 256000 MB

10000048-core 192000 MB

12000048-core 288000 MB

14000048-core 384000 MB

14000064-core 256000 MB

15000064-core 384000 MB

15000064-core 512000 MB

15000090-core 720000 MB

15000025GB - 10000GB

25GB - 12000GB

Note:
The storage space cap of an instance specification may vary by region as displayed on the purchase page.

Adjusting Instance Configuration in the Console
1. Log in to the TencentDB for MySQL console, locate the desired instance in the instance list, and select More >Adjust Configurations in the Operation column.
2. In the pop-up window, select the desired configuration and click Submit.
Note:
When the local resources are sufficient, you can enable the QuickChange mode by turning on the QuickChange
toggle on the configuration adjustment page in the console.

©2013-2022 Tencent Cloud. All rights reserved.

Page 40 of 461

TencentDB for MySQL

When you are only adjusting the cloud disk (storage space), which does not involve a restart, the system will provide
options for the execution time if rapid configuration change is enabled.

In some cases, instance restart is not required in the QuickChange mode and the configuration adjustment will takeeffect immediately after you submit the request, as shown below:

When the primary instance triggers migration configuration change, the data validation sensitivity settings will be
displayed, and you can set the data validation speed to high, standard, or low.
High: Suspends the data consistency comparison task when database load pressure increases, to avoid additional
performance impact from the task, which will extend the duration of the data consistency comparison task.
Standard: Suspends the data consistency comparison task when the database load pressure is significant, to prevent
noticeable performance impact.
Low: Perform the data consistency comparison task even when the database load pressure is significant, to shorten
the duration of the task.

©2013-2022 Tencent Cloud. All rights reserved.

Page 41 of 461

TencentDB for MySQL

Adjusting Instance Configuration Through API
You can adjust the instance configuration using the UpgradeDBInstance API. For more information, see
UpgradeDBInstance.

FAQs
Will there be a primary-secondary delay issue during the configuration change?
During the configuration change of the primary instance, data comparison occurs, which might lead to primarysecondary delay.

©2013-2022 Tencent Cloud. All rights reserved.

Page 42 of 461

TencentDB for MySQLWill instance configuration adjustment affect instances?
In the process of TencentDB for MySQL configuration adjustment, data migration may occur, and instances can stillbe accessed during the process. After the migration is completed, there is a switch which causes a shortdisconnection lasting for just seconds, ensure that your business has a reconnection mechanism.
Basic single-node TencentDB for MySQL instances are unavailable for about 15 minutes in the process ofconfiguration adjustment. We recommend you adjust instance configuration during off-peak hours.
Why can't my instance be downgraded?
It may be because the used storage capacity has reached the maximum capacity of the hard disk. To downgrade you
instance, you need to clean up data first and make sure the remaining available capacity accounts for more than 20%of the total capacity or over 50 GB.
Why is my instance in the "Waiting for switch" status for a long time after I adjust instance configurationin the console?
It may be because you select During maintenance time as the Switch Time when you adjust instanceconfiguration in the console, so the instance will not be switched immediately after the adjustment.
To switch immediately, find the target instance in the instance list and click Switch Now in the Operation column.
The switch will cause a momentary disconnection. Make sure that your business has a reconnection mechanism.
How long does it take to upgrade instance configuration?
The time it takes depends on the instance's data volume and data replication speed.
Instances can still be accessed during the upgrade, but after the upgrade is completed, there is a VIP switch whichcauses a short disconnection lasting for just seconds.
How do I view the progress of instance configuration adjustment?
You can view the progress in Task List in the console.
What should I do if the disk space is being used up?
If over 85% disk space is used, we recommend that you delete data no longer used or expand disk space in the
console by selecting More > Adjust Configurations in the Operation column on the right of the instance list.
How do I know whether the QuickChange mode is supported when I adjust instance memory or disk
capacity?
On the configuration adjustment page, if the QuickChange mode is supported, the QuickChange toggle can beturned on or off as needed; otherwise, the toggle cannot be used.
Does expanding memory or disk capacity affect the kernel minor version of the instance?
If the kernel minor version of the instance is not the latest when memory or disk capacity is expanded, it will be
upgraded to the latest. In this case, enabling the QuickChange mode will cause the database to restart.

©2013-2022 Tencent Cloud. All rights reserved.

Page 43 of 461

TencentDB for MySQLWill the instance restart if the QuickChange mode is enabled?
The instance needs to be restarted in some cases. A prompt will appear asking if you want to restart the instance on
the configuration adjustment page.

Note:
If the instance is running the latest kernel minor version, it won’t restart if you only adjust the disk capacity in the
QuickChange mode.
How do I know whether the QuickChange mode is enabled when I upgrade instance configuration in the
console?
You can check the QuickChange switch on the configuration adjustment page: if the switch is toggled on, theQuickChange mode is enabled; otherwise, the mode is disabled.
How do I know whether the QuickChange mode is enabled when I use APIs to adjust instanceconfiguration?
APIs do not support QuickChange for the time being, so instance configuration can be adjusted only by migrating data
if you use APIs. APIs will support QuickChange in the future.
Will database parameters be modified during database configuration adjustment?
The innodb_buffer_pool_size parameter will be modified according to the configuration changes.
Will database parameters be modified during database configuration adjustment in the QuickChangemode?
It is the same with the normal mode. In the QuickChange mode, some parameters will be modified according to theconfiguration changes.
What is the difference between QuickChange mode and normal mode?
The QuickChange mode requires no data migration, so it takes less time to adjust instance configuration.

©2013-2022 Tencent Cloud. All rights reserved.

Page 44 of 461

TencentDB for MySQL

Change the Port Number：

Last updated 2023-12-27 10:16:47
MySQL instances support modifying the port number of their private IP addresses. This document describes the steps
to change the port number through the console.
Note:
Only supports modifying the port number of private IP address of the MySQL instance; the port for public IP address
is not supported.

Prerequisites
You have created a MySQL instance..
Note:
Before modifying the port for the private IP address of a read-only instance, you must verify that the private network
address for the read-only instance has been enabled.

Modifying the private address port numbers of Master/Read-only
Instances
1. Log in to the TencentDB for MySQL console. In the instance list, click an instance ID or Manage in the operations
column to go to the instance details page.

©2013-2022 Tencent Cloud. All rights reserved.

Page 45 of 461

TencentDB for MySQL

2. Click the edit icon following the private network address.

3. In the displayed dialog box, modify the private network port number and then click OK.

©2013-2022 Tencent Cloud. All rights reserved.

Page 46 of 461

TencentDB for MySQL

Modifying the Private Network Address Port Number of the read-onlyGroup
1. Log in to the TencentDB for MySQL console..
2. Locate the master instance whose read-only group's private network address needs to be modified in the instancelist, then click its instance ID or Manage in the operations column to access the instance details page.
3. Navigate to the read-only instance page and click the edit icon following the private network address of the readonly group.

4. In the displayed dialog box, modify the private network port number and then click OK.

©2013-2022 Tencent Cloud. All rights reserved.

Page 47 of 461

TencentDB for MySQL

Migrating AZ：

Last updated 2024-02-18 11:18:04
You can migrate a TencentDB for MySQL instance to another AZ in the same region. All its attributes, configurations,and connection address will stay unchanged after the migration. The time it takes to migrate the instance is subject tothe instance's data volume.
For example, you can migrate to a new AZ in the following scenarios:
If you want to modify an instance's type, but the current AZ doesn't support the new instance type, you can migrate theinstance to an AZ supporting the new type.
If the current AZ has no remaining resources for scaling, you can also migrate the instance to another AZ in the same
region with sufficient resources to meet your business needs.

Prerequisites
The instance is running and uses the two-node or three-node architecture.
The region where the instance is located has multiple AZs to support cross-AZ migration.

Billing description
This feature is free of charge. There is no charge even for migrating an instance from a single AZ to multiple AZs.

Feature overview
AZ migration will not result in a VIP change.
The source instance is not decoupled from the read-only instances after AZ migration and can still be synced withthem.
You can choose the AZ of read-only instances.
If the target instance has a task lock on the cloud platform during the DTS task, cross-AZ migration cannot be
performed.
If there are ongoing DTS tasks, after AZ migration, you need to restart such tasks.
DTS export will fail if the source instance undergoes a cross-AZ migration switch during dumper export.

Impact©2013-2022 Tencent Cloud. All rights reserved.

Page 48 of 461

TencentDB for MySQLThe instance will be momentarily affected when its AZ is switched; therefore, make sure that your application has an
automatic reconnection mechanism.

Use limits
During the migration of the availability zone, the system will check if the instance disk is overused. If the disk isoverused, the migration of the availability zone cannot be carried out. It is recommended to retry after expanding the
disk. If the disk space has exceeded the maximum storage limit of the current instance specification, it isrecommended to retry after upgrading the instance specification configuration. For detailed specifications, disk limits,and related operations, please refer to Adjusting Database Instance Specifications.
RO instances do not support cross-regional migration.
The migration of the availability zone does not currently support enabling instances with the database proxy. Pleaseturn off the database proxy before migrating across availability zones.
During the migration switch, access via the RO group is not possible (excluded).
Under the dual-node and triple-node architecture, the selection of the primary and secondary availability zones for
migration is subject to regional and remaining resource restrictions. When migrating in the console, select the target
availability zone, and the secondary availability zone option will automatically update.
RO instances in the same availability zone as the primary instance will by default migrate to the target availability zone
with the primary instance. RO instances not in the same availability zone as the primary instance do not currently
support the migration of availability zone operations.

Migration type
Migration
Type
Migrationfrom one
AZ toanother
AZ

Supported
Applicable Scenario

The AZ where the instance is located is under full load or other conditions that
affect the instance performance.

Instance
Types
Source,read-only,and disasterrecovery
instances

Migration

You can improve the disaster recovery capability of the instance and implement

Source,from one
AZ tomultiplecross-data center disaster recovery. Source and replica instances are located indifferent AZs. Multi-AZ instances can withstand higher levels of disasters thansingle-AZ instances. For example, the latter can tolerate server- and rack-levelread-only,and disasterrecoveryAZsfailures, while the former can tolerate data center-level failures.

instances©2013-2022 Tencent Cloud. All rights reserved.

Page 49 of 461

TencentDB for MySQL

Migration

You want to meet specific feature requirements.

Source,from
multipleread-only,and disaster

AZs toone AZ

recovery
instances

Directions
1. Log in to the TencentDB for MySQL console. In the instance list, click an instance ID or Manage in the Operation
column to enter the instance details page.
2. On the Instance Details page, select Basic Info > Region/AZ and click Migrate to New AZ, or selectAvailability Info > Deployment Mode and click Modify Replica AZ.

3. In the pop-up window, adjust the relevant configurations and click Submit after confirming that everything iscorrect.

©2013-2022 Tencent Cloud. All rights reserved.

Page 50 of 461

TencentDB for MySQLNew AZ: You can change the source AZ in the drop-down list or select Yes for Multi-AZ Deployment to modify the
replica AZ.
Delay Threshold for Data Consistency Check: This option is available only when you change the primary AZ. The
threshold can be an integer between 1 and 10 seconds.
Note:
There may be a delay during the data consistency check. You need to set a data delay threshold. The databaseconsistency check will be paused when the delay exceeds the set value and will be resumed when the delay drops
below the threshold. If the threshold value is too small, the migration may take longer.
Switch Time: You can choose to switch during the maintenance time or upon migration completion. For more
information, see Setting Instance Maintenance Time.
Same Availability Zone RO Instance Migration: (This setting only appears when the primary instance has a readonly instance in the same availability zone.) Select whether the same availability zone RO should follow the primary
instance to migrate to the new availability zone.

：

Note

During the process of adjusting configurations, data migration may occur within the instance. However, this will notaffect the accessibility of the instance. After the migration is complete, a switch will occur, resulting in a second-level
disconnection. Please ensure that your operations possess a reconnection mechanism.

©2013-2022 Tencent Cloud. All rights reserved.

Page 51 of 461

TencentDB for MySQL

Primary/Replica Switch：

Last updated 2023-12-27 10:17:46
MySQL supports the switch of primary and secondary databases. In the event of an instance failure, the system
automatically promotes the secondary database to primary to ensure system availability and data integrity. In addition
to automatic switch during anomalous conditions such as failures, you can also manually switch the databases via theconsole.

BackgroundIn enterprise-level applications, the database often forms a critical component of the business system. Any database
failure or downtime can have serious implications on business operations. To safeguard system availability and data
integrity, high-availability solutions such as primary-replica replication are implemented. Primary-replica switch is a
crucial technical method within the replication scheme, which enables a quick switch to the backup database when
the primary database is faulty, averting business interruptions and data losses.

Prerequisites
The instance architecture is set to either two-node or three-node.
The instance is in running status, with no ongoing tasks.

©2013-2022 Tencent Cloud. All rights reserved.

Page 52 of 461

TencentDB for MySQL

Precautions
During the primary-secondary database switch, a momentary disconnection occurs. We recommend that you performthe switch during off-peak hours and make sure that your application has a reconnection mechanism.
After the switch, the instance connection address remains the same. The original primary instance converts into asecondary instance, and the application automatically connects to the new primary instance (formerly the secondary
instance).

The steps are as follows:
Note:
Automatic fallback is not supported after the primary/secondary switch, but manual fallback can be done if needed(i.e., perform another primary/secondary switch after the first one is completed).
1. Log in to the TencentDB for MySQL console. In the instance list, click an instance ID or Manage in the operation
column to access the instance details page.
2. On the Instance Details page, click Switch Primary/Secondary under Availability Info.

3. In the pop-up window, select the switch time, check "With the Primary/Secondary instance switch, there will
be a brief disconnection; ensure that your application has a reconnection mechanism", and click OK.
During Maintenance Period: When data synchronization between primary and secondary AZs has been completed,the system will switch the primary and secondary instances in the next maintenance period. During this period, theinstance status shows as Pending Primary/Secondary Switch and operations such as configuration adjustments or
instance termination cannot be performed. For operations related to setting the instance maintenance time, please see
Setting Instance Maintenance Time.

©2013-2022 Tencent Cloud. All rights reserved.

Page 53 of 461

TencentDB for MySQL

Switch Immediately: The switch will occur immediately upon the completion of data synchronization between the
primary and secondary AZs.

FAQs
Will the instance address change after the primary and secondary database switch?
The instance address remains the same after the switch. The original primary instance works as a secondary, withapplications automatically connecting to the new primary instance (formerly the secondary).
After a manual switch, if an instance is upgraded or expanded, will this affect or reset the information of
the primary and secondary AZs?
The switch will not affect or reset the information of the primary and secondary AZs.

©2013-2022 Tencent Cloud. All rights reserved.

Page 54 of 461

TencentDB for MySQL

Terminating Instance：

Last updated 2024-07-22 14:36:22

Overview
You can return the instances in the console based on your business needs.
After a monthly subscribed instance is returned, it will be moved to the TencentDB recycle bin and retained there forseven days. During the retention period, the instance cannot be accessed, but it can be restored after renewal.
After a pay-as-you-go instance is returned, it will be moved to the TencentDB recycle bin and retained there for 24hours. During the retention period, the instance cannot be accessed, but it can be restored after renewal.
When an instance is returned and its status has changed to Isolating, it will no longer generate fees.
Note:
After the instance is terminated, its data cannot be recovered, and its backup files will also be terminated, so the datacannot be restored in the cloud. Store your backup files safely elsewhere in advance.
After an instance is terminated, its IP resources will be released simultaneously. If the instance has read-only
instances or disaster recovery instances:
Read-only instances will be terminated at the same time.
Disaster recovery instances will disconnect their sync connections and be promoted to source instances automatically.

Directions
1. Log in to the TencentDB for MySQL Console, select the target instance in the instance list, and select More >Terminate/Return or Terminate/Return & Refund in the "Operation" column.

2. In the pop-up window, read and click I have read and agreed to Termination Rules and click Terminate Now.

©2013-2022 Tencent Cloud. All rights reserved.

Page 55 of 461

TencentDB for MySQL©2013-2022 Tencent Cloud. All rights reserved.

Page 56 of 461

TencentDB for MySQL

Instance UpgradeUpgrading the database version of MySQL
5.5 and MySQL 5.6：

Last updated 2023-11-20 15:25:07

Overview
This document describes how to upgrade the TencentDB for MySQL engine in the console.
TencentDB for MySQL supports database engine upgrade on the following versions:
From MySQL 5.5 to MySQL 5.6
From MySQL 5.6 to MySQL 5.7
From MySQL 5.7 to MySQL 8.0﻿Note:
Database engine downgrading is not supported.
Upgrading across major versions is not supported. For example, to upgrade a TencentDB for MySQL 5.5 instance to
MySQL 5.7 or later, you have to upgrade it to MySQL 5.6 first.
Currently, MySQL 5.7 cannot be upgraded to MySQL 8.0.
Single-node instances of the cloud disk edition don't support engine version upgrade.

Upgrade Rules
The create table ...

as select ... syntax is not supported.

Source-replica sync in TencentDB for MySQL 5.6 and 5.7 is implemented based on GTID. Only InnoDB is supported
by default.
MyISAM tables will be converted to InnoDB tables during upgrade from MySQL 5.5 to 5.6 if the last full backup islogical cold backup. We recommend you complete the conversion first before upgrading.
During upgrade, TencentDB for MySQL will clear the slow_log table. Save the logs before upgrading if necessary.
If an instance to be upgraded is associated with other instances (e.g., source or read-only instances),these instances will be upgraded together to ensure the data consistency.
TencentDB for MySQL upgrade involves data migration and generally takes a relatively long time. Your business will
not be affected during the upgrade and can be accessed as per usual.
Instance switch will be required after version upgrade is completed (that is, the MySQL database may bedisconnected for seconds). We recommend you use applications configured with auto reconnection feature and©2013-2022 Tencent Cloud. All rights reserved.

Page 57 of 461

TencentDB for MySQL

conduct the switch during the instance maintenance time. For more information, see Setting Instance MaintenanceWindow.
If the number of tables in a single instance exceeds one million, upgrade may fail and database monitoring may beaffected. Make sure that the number of tables in a single instance is below one million.

Directions
1. Log in to the TencentDB for MySQL console, find the target instance in the instance list, and select More >Upgrade Version in the Operation column.
Note:
MySQL 8.0 cannot be upgraded to a later version.
2. In the pop-up window, select the target database version and click Upgrade.
As database upgrade involves data migration, a momentary disconnection from the MySQL database may occur after
the instance upgrade is completed. You can set the switch time to During maintenance time, so that the switch will
be initiated within the next maintenance time after the upgrade.
Note:
When you select During maintenance time for Switch Time, the switch will not occur immediately after the
database specification upgrade is completed; instead, the sync will continue till the instance goes into the next
maintenance time when the switch will be performed. As a result, the overall time it takes to upgrade the instance
may be extended.

©2013-2022 Tencent Cloud. All rights reserved.

Page 58 of 461

TencentDB for MySQL

FAQs
Will TencentDB for MySQL automatically back up data before upgrade?
TencentDB for MySQL adopts the daily real-time dual-server hot backup mechanism, which supports lossless
restoration of data from the last 7–1830 days based on data backup and log backup (binlog).
Can TencentDB for MySQL be downgraded from MySQL 5.7 to MySQL 5.6?
No. Database engine downgrading is not supported. To use a MySQL 5.6 instance, you need to terminate or returnthe existing MySQL 5.7 instance, and then purchase a MySQL 5.6 instance.

©2013-2022 Tencent Cloud. All rights reserved.

Page 59 of 461

TencentDB for MySQLWill there be a source-replica delay during upgrade?
Source instance upgrade requires data comparison and may cause a source-replica delay.
Will the instance switch after database engine version upgrade affect my TencentDB for MySQL
instance?
The upgrade won't affect your business, but the TencentDB for MySQL instance may be disconnected for a few
seconds. We recommend you configure an automatic reconnection feature for your application and conduct the switch
during the instance maintenance time.
How long will it take to upgrade the database engine version of a TencentDB for MySQL instance? How
do I check the upgrade progress?
The time it takes depends on the instance's data volume and the read requests to replicate data.
TencentDB for MySQL upgrade involves data migration and generally takes a relatively long time. Your business will
not be affected during the upgrade and can be accessed as per usual.
Why is the instance always in the "Waiting for switch (after upgrade)" status?
It may be because you select During maintenance time for Switch Time, and the switch will be initiated within thenext maintenance time after the upgrade.
To switch immediately, find the target instance in the instance list and click Switch Now in the Operation column.
The switch will cause a momentary disconnection. Make sure that your business has a reconnection mechanism.

©2013-2022 Tencent Cloud. All rights reserved.

Page 60 of 461

TencentDB for MySQL

Upgrading from MySQL 5.7 to MySQL 8.0：

Last updated 2023-11-20 15:28:58
TencentDB for MySQL supports direct database version upgrade through the console. This document describes how
to upgrade the CDB engine from MySQL 5.7 to MySQL 8.0 in the console.

Overview
MySQL 8.0 offers significant performance improvements and enhanced features. Its performance under highconcurrency and large data volume scenarios is particularly prominent, offering greater system performance andstability.
The upgrade of the following database engine versions is supported by TencentDB for MySQL:
From MySQL 5.5 to MySQL 5.6﻿From MySQL 5.6 to MySQL 5.7﻿From MySQL 5.7 to MySQL 8.0
Note:
Single-node instances of the cloud disk edition do not support engine version upgrade.
The upgrade process has no impact on existing business.

Considerations
Feature Limits
Limit Type

Description

Instance
LimitsOnly two-node and three-node local disk instances support the upgrade operation from MySQL
5.7 to 8.0.
If a master instance has multiple read-only instances, the read-only instances will be upgraded
together.
If a master instance has a disaster recovery instance, the disaster recovery instance must firstbe released before upgrading. After the upgrade is completed, a new disaster recovery instancecan be recreated.
Before initiating the database version upgrade, ensure the instance status is running, and there
are no other tasks being executed or to be executed. If there are other tasks, please wait until
the task is completed.
Before upgrading, a compatibility check will be performed on the instance. The check results©2013-2022 Tencent Cloud. All rights reserved.

Page 61 of 461

TencentDB for MySQL

are valid for 24 hours. If it exceeds this time, you need to recheck it. During the check, if you add
a read-only instance or a disaster recovery instance, you also need to re-execute the task.
Upgrading across major versions is not supported. For example, MySQL 5.6 cannot be directly
upgraded to MySQL 8.0. You need to upgrade it to MySQL 5.7 first, and then upgrade to
MySQL 8.0.
UpgradeLimitsDowngrading after upgrade is not supported.
Note:
After the upgrade is completed, backup sets of the old version cannot be used to restore thenew version instance. If you need to perform cloning or rollback operations, please select the
backup set or point in time generated after the instance upgrade. Backup sets of older versions
can be downloaded for local restoration operations.

After upgrading the database instance to MySQL 8.0, the unsupported settings in the sql_mode
parameter will be reset to the default values of MySQL 8.0.
If a partition table is used in the RocksDB storage engine, upgrading to MySQL 8.0 is notsupported. You need to modify it to the InnoDB engine or delete the partition table to upgrade.
If there are tables, views, stored procedures and triggers that contain MySQL 8.0 reserved
keywords in the database instance, the upgrade will fail.
Database
LimitsIf stored procedures, triggers, views, or functions in the database contain Changes in MySQL
8.0, the upgrade will fail.
If you are using the MyISAM or Memory engines, upgrading is not supported. Please convert to
the InnoDB engine first.
Note:
If your database is already running on the InnoDB engine, but some tables are still using otherengines, please use the ALTER TABLE <table name> engine=InnoDB; command to convert
those tables to the InnoDB engine before upgrading.

Preparation
Please be sure to carefully compare the differences between the versions before and after the upgrade. We
recommend testing syntax on a new MySQL 8.0 instance-this will help avoid issues with lower-version syntax orfeatures not being supported after the upgrade. For more information, please refer to List of functional differences
between MySQL8.0 and MySQL5.7.
We recommend that you clone the original instance for upgrade testing first, and confirm that all functions are normal
before upgrading.
Before upgrading, please check whether there is a successful record of full data backup in the past week. If
necessary, please perform a full data backup.

©2013-2022 Tencent Cloud. All rights reserved.

Page 62 of 461

TencentDB for MySQL

During the database upgrade, a brief disconnection of the TencentDB for MySQL service may occur. It is suggested
that you carry out the upgrade during off-peak period or ensure your application has an automatic reconnection
mechanism.
Please ensure that free disk space is available before upgrading.
Before upgrading, review the Keywords and Reserved Words that you should avoid using them when creating custom
functions.
To ensure stability and performance of MySQL in the new version, after the database version has been upgraded,
CDB will not support the inspection or modification of MySQL 5.7 parameters that have been deprecated in MySQL
8.0. For more information, please refer to Options and Variables Removed in MySQL 8.0. Before upgrading, it isrecommended that you back up modification records of relevant parameters for subsequent operations and audits.

Directions
1. Log in to the TencentDB for MySQL console, fin the target instance in the instance list, and select More > Upgrade
Version in the Operation column.
Note:
You can also click on the Instance ID to go to the instance details page and click Upgrade Version after the
database version.

2. In the Database Version Upgrade window, complete the required settings, read and select the Database Version
Upgrade Rule, then click on Upgrade Check.

©2013-2022 Tencent Cloud. All rights reserved.

Page 63 of 461

TencentDB for MySQLParameter

Description

Delay Threshold for
Data Consistency

Enter an integer from 1 to 10 (The new configuration may take longer to take effect

Check

Switch Time

Database Version

if the threshold is lower.)
During Maintenance Time: Set the switch time to During maintenance time, so that theswitch will be initiated within the next maintenance time after the upgrade. For more
information, see Setting Instance Maintenance Time.
Upon Upgrade Completion: Set the switch time to Upon Upgrade Completion, so that theswitch will be initiated immediately after the instance data migration has been
completed.
MySQL 8.0 is selected by default.

©2013-2022 Tencent Cloud. All rights reserved.

Page 64 of 461

TencentDB for MySQL

3. During the upgrade check process, the system will start a check task to verify whether the instance to be upgradedmeets the criteria of not having any disaster recovery instances and having parameter configurations thatmeet the specifications. After the check is completed and the upgrade conditions are met, click Upgrade.
3.1 Verify whether there are any disaster recovery instances under the master instance. If master instance has adisaster recovery instance, the check will fail. You need to release the disaster recovery instance first, and recreate it
once the upgrade is completed.
3.2 The system will automatically verify if the parameter configuration is up to the specified standards. If it doesn'tmeet the specification requirements, adjustments can be made according to the error message in the check box.
Note:
After the upgrade check task is executed successfully, please perform the upgrade within 24 hours. If it times out,
check again.
4. After upgrading, return to the instance list. Select Task List from the left sidebar to track the progress and details of
the database version upgrade task for the instance.
5. Find the Task ID of the recent database version upgrade in the task list, and you can query the task progress. By
clicking on Task Details in its Operation column, more upgrade-related information will be displayed.
6. The database version upgrade is completed when the instance status changes from Changing configuration to
Running.
Note:
If you select During Maintenance Time as the switch time for the upgrade, the instance status will display Awaiting
switch if the next maintenance time has not been reached after the instance upgrade is completed. If an immediateswitch is necessary, you can click Switch Now in the Operation column of the instance list. However, be aware thatthe switch will involve a momentary disconnection lasting for a few seconds. Please ensure that your business isequipped with a reconnection mechanism.

Appendix: MySQL 8.0 vs. MySQL 5.7
MySQL 8.0 introduces over 300 new features, including invisible indexes, descending indexes, functional indexes,
common table expressions, window functions, instant column addition, implicit primary keys and more. These
capabilities make development more adaptable and efficient.
MySQL 8.0 introduces improvements in performance, implementing features such as Histograms, HASH JOINS,
parallel queries, and JSON columns that enhance capability. These additions have served to increase both the query
performance and response time of the database, enabling it to process large-scale data and complex queries more
swiftly.
MySQL 8.0 supports the caching_sha2_password authentication plugin, thus enhancing security.
MySQL 8.0 Optimizer enhances functionality.
MySQL8.0 enhances replication performance.
MySQL 8.0 supports the creation of multi-valued indexes and optimization under derived conditions.

©2013-2022 Tencent Cloud. All rights reserved.

Page 65 of 461

TencentDB for MySQLMySQL 8.0 supports the reading of MySQL authorization tables.
MySQL 8.0 supports resource allocation control.

FAQs
Will TencentDB for MySQL automatically back up data before upgrade?
TencentDB for MySQL adopts the daily real-time dual-server hot backup mechanism, which supports lossless
restoration of data from the last 7–1830 days based on data backup and log backup (binlog).
Can TencentDB for MySQL be downgraded from MySQL 8.0 to MySQL 5.7?
No. Database engine downgrading is not supported. To use a MySQL 5.7 instance, you need to terminate or returnthe existing MySQL 8.0 instance, and then purchase a MySQL 5.7 instance.
Will there be a source-replica delay during upgrade?
Source instance upgrade requires data comparison and may cause a source-replica delay.
Will the instance switch after database engine version upgrade affect my TencentDB for MySQL
instance?
The upgrade won't affect your business, but the TencentDB for MySQL instance may be disconnected for a few
seconds. We recommend you configure an automatic reconnection feature for your application and conduct the switch
during the instance maintenance time.
How long will it take to upgrade the database engine version of a TencentDB for MySQL instance? How
do I check the upgrade progress?
The time it takes depends on the instance's data volume and the read requests to replicate data.
TencentDB for MySQL upgrade involves data migration and generally takes a relatively long time. Your business will
not be affected during the upgrade and can be accessed as per usual.
You can monitor the progress and details of tasks in the task list. Keep an eye on the task execution progress for
insight into the upgrade status.
Why is the instance always in the "Waiting for switch (after upgrade)" status?
It may be because you select During Maintenance Time for Switch Time, and the switch will be initiated within thenext maintenance time after the upgrade.
To switch immediately, find the target instance in the instance list and click Switch Now in the Operation column.
The switch will cause a momentary disconnection. Make sure that your business has a reconnection mechanism.

©2013-2022 Tencent Cloud. All rights reserved.

Page 66 of 461

TencentDB for MySQL

Upgrading Kernel Minor Version：

Last updated 2024-07-22 14:39:28
TencentDB for MySQL supports automatic or manual kernel minor version upgrade. Upgrading adds new features,
improves performance, and fixes issues.
For details on the TencentDB for MySQL kernel minor version, see Kernel Version Release Notes.

Overview
Automatic upgrade:
Scenario 1: When a severe bug or security vulnerability occurs in TencentDB for MySQL, the system will perform
database kernel minor version upgrade during the maintenance window and send upgrade notifications through theconsole Message Center and SMS.
Scenario 2: When a TencentDB for MySQL instance is migrated due to instance configuration upgrade/downgrade,
storage capacity expansion/reduction, or database version upgrade, etc., the system will automatically upgrade theinstance's kernel to the latest minor version. If the source instance has read-only instances, the system willautomatically determine the source-replica sync compatibility. If the source instance is migrated, a minor version later
than that of the read-only instances will not be used.
Manual upgrade:
You can also manually upgrade kernel minor version in the console.

Upgrade rules
If an instance to be upgraded is associated with other instances (e.g., source instance and read-only instances), these
instances will be upgraded together to ensure data consistency.
TencentDB for MySQL upgrade involves data migration. The time it takes to migrate an instance depends on the sizeof the instance's data. Your business will not be affected during the upgrade and can be accessed as per usual.

Notes
Instance switch will be required after version upgrade is completed, which will cause your instance to disconnect forseconds. We recommend that you conduct the switch during the instance maintenance time. Make sure that yourbusiness has a reconnection mechanism. For more information, see Setting Instance Maintenance Window.
If the number of tables in a single instance exceeds one million, upgrade may fail and database monitoring may beaffected. Make sure that the number of tables in a single instance is below one million.

©2013-2022 Tencent Cloud. All rights reserved.

Page 67 of 461

TencentDB for MySQLThe kernel minor version cannot be downgraded once upgraded.

Directions
1. Log in to the TencentDB for MySQL console. In the instance list, click the target instance ID or Manage in the
Operation column to enter the instance details page.
2. In the Configuration Info section, click Upgrade Kernel Minor Version.

3. In the pop-up window, set the configuration items and click Upgrade.
Delay Threshold for Data Consistency Check: This option is available only during source instance upgrade, which
can be an integer between 1 and 10 seconds. There may be a delay during the data consistency check. You need to
set a data delay threshold. The database consistency check will be paused when the delay exceeds the set value andwill be resumed when the delay drops below the threshold. If the threshold value is too small, the migration may takelonger.
Note:
As database upgrade involves data migration, a momentary disconnection from the MySQL database may occur after
the upgrade is completed. We recommend that you set the switch time to During maintenance time, so that theswitch will be initiated within the next maintenance time after the instance upgrade is completed.

©2013-2022 Tencent Cloud. All rights reserved.

Page 68 of 461

TencentDB for MySQL©2013-2022 Tencent Cloud. All rights reserved.

Page 69 of 461

TencentDB for MySQL

Upgrading Two-Node Instances to ThreeNode Instances：

Last updated 2024-07-22 14:39:43

Overview
This document describes how to upgrade a TencentDB for MySQL instance from two-node to three-node in the
console.
Note:
Only TencentDB for MySQL two-node instances can be upgraded to three-node.
The upgrade will not interrupt the instance service.
You can also purchase three-node instances on the purchase page.

Directions
1. Log in to the TencentDB for MySQL console. In the instance list, click an instance ID or Manage in the Operation
column to enter the instance details page.
2. In the Configuration Info section, click Upgrade to Three-Node next to Architecture.

3. In the pop-up dialog box, specify the data replication mode and availability zones and click Submit.

©2013-2022 Tencent Cloud. All rights reserved.

Page 70 of 461

TencentDB for MySQL

Data Replication Mode: For more information, see Database Instance Replication.
Multi-AZ Deployment: Multi-AZ deployment protects database service from being interrupted in case of database
failures or availability zone failures.
For a three-node instance, its replicas can be deployed in the source AZ or different AZ. We recommend that you
deploy one replica in the source AZ and another replica in a different AZ.
Currently, only some source AZs support selecting different AZs as replica AZs. You can view these source AZs andthe supported replica AZs on the purchase page.

4. After the payment is completed, you will be redirected to the instance list. After the status of the instance changes
from Changing configuration to Running, it can be used normally.

FAQs
How do I view the architecture information of an instance?

©2013-2022 Tencent Cloud. All rights reserved.

Page 71 of 461

TencentDB for MySQL

Log in to the TencentDB for MySQL console. In the instance list, view the architecture information in the
Configuration column; or click an instance ID or Manage in the Operation column to enter the instance details
page, where you can view the architecture information in the Configuration Info > Architecture section.

How do I view the source and replica AZs of an instance?
Log in to the TencentDB for MySQL console. In the instance list, click an instance ID or Manage in the Operation
column to enter the instance details page, where you can view the source and replica AZs in the Availability Info
section.

©2013-2022 Tencent Cloud. All rights reserved.

Page 72 of 461

TencentDB for MySQLCPU Elastic Expansion
Overview：

Last updated 2023-12-27 10:19:09
This section introduces the features related to CPU Elastic Scaling in MySQL.

Chapter Overview
CPU Elastic Scaling

Description

Document Guidance

Feature Overview

This section introduces the background,implementation process, instructions, and operation
scope of the CPU Elastic Scaling feature.

INTRODUCTION

Auto
Scaling

Provides guidance on how to enable, disable, and set
threshold policies for the automatic CPU Elastic
Scaling feature.

Configuring Auto Scaling

Manual
Scaling

Provides guidance on how to enable, disable, and set
threshold policies for the manual CPU Elastic Scaling
feature.

Configuring Manual
Scaling

Event
Alarm

Introduces metrics related to the CPU Elastic Scaling
feature and the methods to configure event alarms.

Enabling Event Alarms

Performance Test

Evaluates the performance after enabling the CPU
Elastic Scaling feature by employing the performance
test tool SysBench.

Performance

Billing

Introduces the billing method and unit price of the CPU
Elastic Scaling feature.

Billing Description

FAQs

Updates on common issues encountered when using
the CPU Elastic Scaling feature and their solutions.

FAQs

Operation©2013-2022 Tencent Cloud. All rights reserved.

Page 73 of 461

TencentDB for MySQL

Overview：

Last updated 2023-12-27 11:01:17
MySQL supports manual scaling of the current instance's CPU upper limit and automatic scaling based on set CPU
average usage thresholds and observation periods. This provides better mitigation for sudden request performancepressure, accommodating peak business traffic and ensuring online business stability. This section provides a brief
overview of the CPU Elastic Expansion feature.

BackgroundIn many business scenarios, peak traffic periods or sudden traffic surges can impose tremendous pressure on server
loads. The CPU utilization of the application can skyrocket, and if CPU resources are not scaled in a timely manner, it
could lead to system performance degradation, increased request response time, and other issues, severely affectinguser experience and satisfaction. Beyond burst traffic scenarios, situations such as low cache hit rate in the database,ineffective indexes, database deadlocks, complex database query statements, a high volume of concurrent updates,
coupled with insufficient hardware configurations, can also lead to CPU overloads.
Traditional Solutions

Upon detecting a CPU overload, users typically manually upgrade it through the console and wait for the upgrade to
be completed. The upgrade duration, influenced by the amount of data, is uncertain. Moreover, the upgrade process
may result in transient disruptions, affecting regular operations. After the business traffic become normal after the
upgrade, users need to manually apply for a downgrade through the console. Thus, the traditional solution poseschallenges such as the necessity for rapid response, unpredicted time frames, risk of transient disruptions, and an
extensive follow-up workload.
CPU Elastic Scaling©2013-2022 Tencent Cloud. All rights reserved.

Page 74 of 461

TencentDB for MySQLThe CPU Elastic Scaling feature, underpinned by the advantages of the cloud environment, allows for the dynamic
assignment of CPU resources. As the database traffic increases or CPU resource usage escalates, it can
automatically allocate more CPU resources, then scale in after peak periods. Users can choose whether to enable the
CPU Elastic Scaling feature via the console, and dynamically configure the database's CPU resources based on thebusiness needs and traffic volume. Consequently, elastic scaling can be achieved to handle peak pressure, ensuring
superior performance, high availability, and stability of the database instance.

Feature TypeThe CPU Elastic Scaling feature can be categorized into automatic scaling and manual scaling. If automatic scaling isenabled, you need to set the thresholds for both scale-out and scale-in. For manual scaling, you need to set the
number of CPU cores to be added, and manual scaling doesn't automatically scale in - it must be manually stopped.

Automatic scale-out
Auto scale-out
Upon enabling CPU Elastic Scaling -> Auto Scaling, when the average CPU utilization of the database instancewithin the observation window reaches the set threshold, the system will double the number of CPU cores on the basisof the original computing specification. For instance, if the original computing specification has 4 cores, it will be
increased to 8 cores. Concurrently, the IOPS of the instance will also rise. For each additional core, the IOPS
increases by 1,000. If the user's Tencent Cloud account balance is insufficient or there are not enough CPU resourceson the host (which rarely occurs), the scaling will not proceed, and a scaling failure event will be generated later.

：

Note

Only supports doubling the number of CPU cores based on the original computing specification, and no further
increase is supported. For instance, after the original CPU cores are doubled to 8, it cannot be increased to 16.
Auto Scale-in©2013-2022 Tencent Cloud. All rights reserved.

Page 75 of 461

TencentDB for MySQL

Upon enabling CPU Elastic Scaling -> Auto Scaling, during the set observation window for auto scale-in, if the
CPU utilization is below the set threshold, the system will automatically reduce both the CPU cores and IOPS to theoriginal computing specifications.

：

Note

After enabling CPU Elastic Scaling -> Auto Scaling, the system will monitor the database instance based on themost recent configuration parameters. When the instance meets the conditions for automatic scale-in, the system willautomatically scale in the instance.
For details about the operations of enabling auto-scaling, disabling auto-scaling, and setting the scale-in and scale-out
thresholds, see Setting Auto Scaling.

Manual scaling
Manual Scale-out
When CPU Elastic Scaling -> Manual Scaling is enabled, the instance operates according to the number of CPU
cores after scale-out.
Manual Scale-inUpon enabling CPU Elastic Scaling -> Manual Scaling, when business no longer requires additional CPU
resources, users must manually disable CPU Elastic Scaling, otherwise charges will continue.
For details about the operations of enabling and disabling manual scaling, see Setting Manual Scaling.

Comparison between Automatic and Manual Scaling
FeatureType

Screenshot After Successful
Feature Enabling

CPU
Upper
Limit

Scale-inProcess

Event
Alarm

Billing

Billing

Auto
Scaling

Twice theoriginal

Automaticallyscales innumber of
CPU
cores

according to
the set scale-inthreshold.

begins only
after auto
scale-out is
Supportsuccessfully
triggered,and ceases
after thescale-in.

ManualSupports

Unable to

Scaling1-core unit
scale-out,
up to twice
theoriginal

automaticallyscale in,manual stop of
scaling isrequired. After

number ofmanual scaling©2013-2022 Tencent Cloud. All rights reserved.

SupportBilling willcontinue
from theenabling ofmanualscaling until

Page 76 of 461

TencentDB for MySQLCPU

is stopped, theit iscores.

systemimmediately
scales in to theoriginal CPU
core count.

disabled.

Event Alarm Explanation
For both automatic and manual scaling out, relevant event alarms can be set and configured for notifications. The
following are the event metrics and descriptions related to the CPU Elastic Scaling feature.
Scaling Type

Auto Scaling

Manual Scaling

Event Metrics

Description

CPUExpansion

Automatic CPU scale-out issuccessful.

CPUExpansionFailed

Automatic CPU scale-out failed.

CPUConstraction

Automatic CPU scale-in is
successful.

CPUExpansion

Manual CPU scale-out issuccessful.

CPUExpansionFailed

Manual CPU scale-out failed.

CPUConstraction

Manual CPU scale-out is stopped.

There are two causes for automatic and manual scaling failures: insufficient balance in the Tencent Cloud account of
the user or inadequate CPU resources on the host (rarely occurs).If insufficient account balance leads to a scaling
failure, users can recharge their account and retry. For other causes, please submit a ticket for assistance.
For details about the steps to configure event alarms, please refer to Activating Event Alarms.

Feature Impact Overview
The CPU Elastic Scaling feature is concurrently deployed on both primary and secondary nodes on two-node andthree-node instances. Therefore, if an HA switch occurs after the CPU Elastic Scaling feature is enabled, theswitched-to node will also reach the scaled-out CPU specifications. After automatic scale-in or stop of manual scaling,
the system will restore to the original CPU specifications.

©2013-2022 Tencent Cloud. All rights reserved.

Page 77 of 461

TencentDB for MySQLThe feature should be separately enabled for read-only instances and disaster recovery instances, which will not
simultaneously scale out. In other words, the read-only instances and disaster recovery instances attached to theprimary instance will not simultaneously expand their CPU resources even after the CPU Elastic Scaling feature of the
primary instance is triggered. The CPU Elastic Scaling feature must be enabled for these two types of instances
separately.

Related Operations
Configuring Auto Scaling
Configuring Manual Scaling
Enabling Event Alarms©2013-2022 Tencent Cloud. All rights reserved.

Page 78 of 461

TencentDB for MySQL

Configuring auto scale-out：

Last updated 2024-02-18 11:15:42
This section describes how to enable and disable automatic scaling.

Prerequisites
The instance architecture uses MySQL general two-node/three-node or single-node local disk (read-only instance).
The instance specification is equal to or less than 32 cores before the CPU Elastic Scaling feature is enabled.
Your Tencent Cloud account has sufficient balance.
Note:
For information on billing of automatic scaling, please see Billing Overview.

Enabling Automatic Scaling
1. Log in to the TencentDB for MySQL console. In the instance list, click an instance ID or Manage in the operations
column to go to the instance details page.
2. On Instance Details -> CPU Auto Scaling, click Enable.

3. In the CPU Auto Scaling window, complete the following settings, and after confirming the scaling fee, click Scale
Now.

©2013-2022 Tencent Cloud. All rights reserved.

Page 79 of 461

TencentDB for MySQLParameter

Description

CPU Auto
Scaling Type

Select Automatic Scaling.

CPU Auto
Scaling
ThresholdObservation
PeriodConfigure the threshold for automatic elastic scale-out triggered by average CPU utilization.
Available options are 40%, 50%, 60%, 70%, 80%, and 90%.
Set the observation period to 1 minute, 3 minutes, 5 minutes, 10 minutes, 15 minutes, or 30
minutes. Within this specified time period, the system will monitor whether the average CPU
utilization of the instance reaches the set scaling threshold. If it does, automatic elastic scaling
will be triggered.
Note:
To mitigate the impact of continuous intermittent peaks, there is a minimum protection periodof 10 minutes during automatic scaling. This means, if the automatic scaling lasts more than
10 minutes, the costs are calculated based on the actual scaling duration. If the automatic©2013-2022 Tencent Cloud. All rights reserved.

Page 80 of 461

TencentDB for MySQL

scaling lasts for no more than 10 minutes, the costs are calculated based on a 10-minuteduration.

CPU
Automatic
Elastic ScaleIn Threshold

Configure the threshold for automatic elastic scale-in triggered by average CPU utilization.
Available options are 30%, 20%, and 10%.

Set the observation period to 5 minutes, 10 minutes, 15 minutes, or 30 minutes. This specifies
Observation
Periodan interval during which the system monitors the average CPU utilization of the instance anddetermines whether it reaches the set scale-in threshold. If the threshold is reached, automatic
elastic scale-in is triggered.

4. After automatic scale-out is triggered successfully, the interface will display as the following:

：

Note

After automatic scaling is enabled, if you need to modify the automatic scaling policy, you can navigate to Instance
Details -> CPU Auto Scaling, and click Modify for reconfiguration.

Disabling Automatic Scaling

：

Note

The billing for automatic scaling starts from the successful triggering of the scale-out operation to the moment ofscale-in. If there is no scale-out operation, no extra fees will be charged.
After automatic scaling is disabled, all expanded CPU capacity will immediately scale in to the original number of CPU
cores, and no further scale-out operations will be triggered based on the scale-out threshold.
1. Log in to the TencentDB for MySQL console. In the instance list, click an instance ID or Manage in the operations
column to go to the instance details page.
2. Navigate to Instance Details -> CPU Auto Scaling and then click Disable.
3. In the pop-up window End CPU Scaling, click OK.

©2013-2022 Tencent Cloud. All rights reserved.

Page 81 of 461

TencentDB for MySQL©2013-2022 Tencent Cloud. All rights reserved.

Page 82 of 461

TencentDB for MySQL

Establishing Manual Scaling：

Last updated 2023-12-27 11:02:38
This section describes how to enable and disable manual scaling.

Prerequisites
The instance architecture uses MySQL general two-node/three-node or single-node local disk (read-only instance).
The instance specification is equal to or less than 32 cores before the CPU Elastic Scaling feature is enabled.
Your Tencent Cloud account has sufficient balance.
Note:
For details about billing of manual scaling, please see Billing Overview.

Enabling Manual Scaling
1. Log in to the TencentDB for MySQL console. In the instance list, click an instance ID or Manage in the operations
column to go to the instance details page.
2. On Instance Details -> CPU Auto Scaling, click Enable.

3. In the CPU Auto Scaling window, complete the settings, confirm the scaling cost, and click Scale Now.

©2013-2022 Tencent Cloud. All rights reserved.

Page 83 of 461

TencentDB for MySQLParameter
CPU Auto Scaling
Type

Additional CPU
Cores Increase

Description
Select Manual Scaling.
Set the number of additional CPU cores to add manually. Scaling by 1 core is supported.
The maximum number of additional CPU cores is equal to the CPU cores of the current
specification. For example, the maximum number of additional CPU cores for the 8-core
16 GB specification is 8.

Additional IOPS
Increase

For each single core increase in CPU, IOPS is concurrently increased by 1,000.

©2013-2022 Tencent Cloud. All rights reserved.

Page 84 of 461

TencentDB for MySQL

4. After manual scaling is enabled, the instance's CPU will immediately scale out according to the number of additional
CPU cores. You can view the current instance's CPU on the Instance Detail -> CPU Elastic Scaling page.
Before Manual Scaling:

After Manual Scaling:

：

Note

After manual scaling is enabled, if you need to modify the number of additional CPU cores, you can access Instance
Detail -> CPU Elastic Scaling and click Edit for reconfiguration.

Disabling Manual Scaling

：

Note

If manual scaling is not disabled, billing will continue.
After manual scaling is disabled, the expanded CPU will promptly restore to its original core count.
1. Log in to the TencentDB for MySQL console. In the instance list, click an instance ID or Manage in the operations
column to go to the instance details page.
2. Navigate to Instance Details > CPU Elastically Scalable and click Disable.
3. In the pop-up window End CPU Scaling, click OK.

©2013-2022 Tencent Cloud. All rights reserved.

Page 85 of 461

TencentDB for MySQL©2013-2022 Tencent Cloud. All rights reserved.

Page 86 of 461

TencentDB for MySQL

Activating Event Alarm：

Last updated 2023-12-27 10:27:01
MySQL supports the Event Alarm feature. When a user sets an event alarm related to CPU elastic scaling andconfigures the alarm notification, it will be triggered if detected:
Auto-scaling (triggered, failed, scale-in)
Manual scaling (enabled, failed, disabled)
Event alarms will notify users via various available methods. This section describes the process of setting event
alarms related to CPU elastic scaling.

Operation Scenarios
Users can implement event alarms to trigger alarms and dispatch corresponding notifications when the relevant statuschanges (CPU performance scaling, CPU performance scaling failure, CPU performance scale-in) after the CPU
Elastic Scaling feature is enabled in MySQL.

The steps are as follows:
Creating an Alarm Policy
1. Log in to the TCOP Console,, then navigate to the Alarm Configuration > Alarm Policy > Policy Management
page by clicking the left sidebar.
2. In the Alarm Policy list, click New Policy.

3. On the policy creation page, configure basic information, alarm rules, and alarm notifications.
Policy Type: Categorized as Primary Monitoring and Secondary Monitoring, each corresponds to different types of
instances.
Alarm Object: You can locate the object instance to be associated by selecting the region where the object is locatedor searching for the instance ID.
Trigger Conditions: Locate the event alarm, click 'Add Event'and add the following alarm events: CPU
Performance Scaling, CPU Performance Failure, and CPU Performance Scale-in.

©2013-2022 Tencent Cloud. All rights reserved.

Page 87 of 461

TencentDB for MySQL

Alarm Notification: You can select a preset or customized notification template. Each alarm policy can be bound to
three notification templates at most. For instructions on how to customize a notification template, see Creating
Notification Template.
Select the preset template.

©2013-2022 Tencent Cloud. All rights reserved.

Page 88 of 461

TencentDB for MySQL

Create a new template.

©2013-2022 Tencent Cloud. All rights reserved.

Page 89 of 461

TencentDB for MySQL

4. After confirming that everything is correct, click Finish.

Associating Alarm Objects
After creating an alarm policy, you can also associate it with other alarm objects (instances requiring CPU
performance scaling-related alarms). An alarm will be triggered when the object meets the alarm trigger condition.
1. In the alarm policy list, click the alarm policy name to enter the alarm policy management page.
2. On the alarm policy management page, click Add Object in the Alarm Object column.
3. In the pop-up dialog box, select the alarm objects to be associated with, and click OK. The alarm objects will be
associated.

©2013-2022 Tencent Cloud. All rights reserved.

Page 90 of 461

TencentDB for MySQL

Performance Manifestation：

Last updated 2023-12-27 10:27:56
This section describes how to use the performance testing tool SysBench to compare the performance after the CPU
Elastic Scaling is enabled.

SysBench Tool Introduction
SysBench is a modular, cross-platform, and multi-threaded performance measurement tool that evaluates primarysystem parameters concerning its operational performance under heavy loads. The tool circumvents the need forcomplex database benchmark configurations, enabling swift understanding of database performance, even without
the necessity of installing a database.

Testing Environment
Note:
The following environment is only used in the example.
Environment Utilized for MySQL Performance Testing:Region/AZ: Beijing - Beijing Zone 7
Client: S5.8XLARGE64 (32-core 64 GB Standard S5)
Client OS: CentOS 8.2 64-bit
Network: Both the CVM and MySQL instances are under the same VPC subnet.
Tested MySQL Instance:
Three groups of instances: Beijing Zone 7, General 2-core 4 GB, two-node MySQLGroup A: NO-CPU-Expand, the CPU Elastic Scaling feature is not enabled.
Group B: AUTO-CPU-Expand, the Automatic CPU Elastic Scaling feature is enabled.
Group B:
Group C: MANUAL-CPU-Expand, the Manual CPU Elastic Scaling feature is enabled.
Group B:
Setting Parameters:
Set console parameter 'max_prepared_stmt_count' to its highest value to cope with high concurrency.

Testing Process
Step 1:©2013-2022 Tencent Cloud. All rights reserved.

Page 91 of 461

TencentDB for MySQL

Create a 'sbtest' database in the system, enable the Automatic CPU Elastic Scaling feature for group B, and enable
the Manual CPU Elastic Scaling feature for group C.
Step 2:
Utilize Sysbench to prepare data, including 10 tables, with each table containing a data volume of 100,000.
Step 3:
Perform a Sysbench read/write test on 10 tables, with each table containing a data volume of 100,000.
Step 4:
Proceed with Sysbench to clear data and disable the Manual CPU Elastic Scaling feature for group C.

Testing Description
The Test can be affected by factors such as testing time, duration, machine used, etc. We suggest performing multiple
tests.

Executed Commands:
Following the above steps, conduct the tests respectively.
Note:
Please replace the 'XXX' in the following command with the internal network address, port number, username, user
password, and database name of the MySQL instance. The specific parameters are explained as follows:
host: Private network address of the tested instance
port: Port number
user: Username
password: Password corresponding to the username
time: Timethreads: Number of concurrent threads
1. Prepare data: 100,000 data volumes in each table, with 10 tables in total.

©2013-2022 Tencent Cloud. All rights reserved.

Page 92 of 461

TencentDB for MySQL

sysbench --db-driver=mysql --mysql-host=xxx --mysql-port=xxxx --mysql-user=xxx --my

2. Execute high concurrency operations on the 100,000 data volume in each table, with 10 tables in total.

©2013-2022 Tencent Cloud. All rights reserved.

Page 93 of 461

TencentDB for MySQL

sysbench --db-driver=mysql --mysql-host=xxx --mysql-port=xxxx --mysql-user=xxx --my

3. Clear the data.

©2013-2022 Tencent Cloud. All rights reserved.

Page 94 of 461

TencentDB for MySQL

sysbench --db-driver=mysql --mysql-host=xxx --mysql-port=xxxx --mysql-user=xxx --myTest Results
Note:
As illustrated below, in the comparative experiment results of the CPU Elastic Scaling feature of three groups of
instances, we can observe:©2013-2022 Tencent Cloud. All rights reserved.

Page 95 of 461

TencentDB for MySQL

Phase One: At 21:03, data injection was initiated. The CPU usage of both NO-CPU-Expand and AUTO-CPU-Expand
exceeded 70%, but the duration did not exceed 1 minute. Therefore, the AUTO-CPU-Expand group did not trigger
automatic scaling, while the MANUAL-CPU-Expand group scaled out immediately upon being operated and ran with 4cores, with the CPU usage less than 50%.
Phase Two: At 21:07, high concurrency testing was initiated. The CPU usage of the NO-CPU-Expand group was
remained over 70%, the CPU usage of the AUTO-CPU-Expand group also exceeded 70%, and it triggered automatic
scaling when the CPU usage remained high for 1 minute. The scaling succeeded within seconds and reduced theusage to less than 50%. The CPU usage of the MANUAL-CPU-Expand group remained below 50%.

Note:
In addition to significant changes in CPU utilization, the performance of instances that have enabled the CPU Elastic
Scaling feature also changes significantly. As demonstrated in the graph below, the TPS and QPS of instances withthe feature enabled are higher than those for which the feature is not enabled. It should be noted, the performance inthe test is affected by factors such as the testing period, duration, machine, etc. Thus, it is recommended to perform
multiple tests and compare the results.

©2013-2022 Tencent Cloud. All rights reserved.

Page 96 of 461

TencentDB for MySQL©2013-2022 Tencent Cloud. All rights reserved.

Page 97 of 461

TencentDB for MySQL

Billing Overview：

Last updated 2023-12-27 10:30:07
This section introduces the billing instructions related to the CPU Elastic Scaling feature.

Billing for Automatic Scaling
Fee Calculation
The CPU Elastic Scaling feature uses pay-as-you-go billing mode, where fees are charged on a minute basis anddeducted once per hour.
Billing Formula = (Unit price x Number of added CPU cores) x Scaling duration (minutes) / 60.

Automatic Scaling Billing Example
1. Suppose a two-node instance in Guangzhou has a CPU with 4 cores. After Automatic Scaling is triggered, it isexpanded to 8 cores. The scaling duration is 1 hour. Given that the unit price in Guangzhou is 0.08 USD/core/hour, thetotal cost would be calculated as follows: 0.08 (Unit price) x 4 (additional CPU cores) x 1 (duration of expansion) =0.32 USD.
2. Suppose a two-node instance in Guangzhou has a CPU with 2 cores. After Automatic Scaling is triggered, it isexpanded to 4 cores, with a scaling duration of 30 minutes. Considering that the unit price in Guangzhou is 0.08
USD/core/hour, the total cost would be calculated as follows: 0.08 (Unit price) x 2 (additional CPU cores) x 30/60(scaling duration) = 0.08 USD.
Note:
Upon enabling CPU Auto Scaling: you will be billed according to the number of CPU cores added when the elastic
scaling is successfully triggered. There will be no additional charges when no scaling is performed.
To mitigate the impact of persistent intermittent peaks, there is a minimum protection time of 10 minutes during autoscaling. That is, if the auto-scaling lasts for more than 10 minutes, the cost will be calculated based on the actual
scaling time. If the auto-scaling lasts no more than 10 minutes, the cost will be calculated with the duration of 10
minutes.

Manual Scaling Billing Description
Fee Calculation
The Manual CPU Elastic Scaling feature adopts the pay-as-you-go billing method, where fees charged on a minutebasis and deducted once per hour.
Billing Formula = (Unit price x Number of added CPU cores) x Scaling duration (minutes)/60.

©2013-2022 Tencent Cloud. All rights reserved.

Page 98 of 461

TencentDB for MySQLManual Scaling Billing Example
In Beijing, a CPU elastic scaling is manually enabled for a two-node instance with a CPU with 2 cores on 10 AM, with
2 cores added. The manual CPU elastic scaling process is then disabled at 5 PM, which means the scaling lasts for 7
hours. Given that the unit price in Beijing is 0.08 USD/core/hour, the total fee would be: 0.08 (unit price) x 2 (additional
CPU cores) x 7 (scaling duration) = 1.12 USD.
Note:
Once Manual CPU Elastic Scaling is started, the number of CPU cores for the instance will immediately increase
based on your configurations and fees will be charged synchronously until you disable manual scaling. Therefore, thesystem will continuously charge since manual scaling is enabled and until it is disabled. For instructions on how todisable manual scaling, please see Disabling Manual Scaling for operation to turn off manual scaling.

Unit Price per Core
Single-node Local Disk (Read-only Instance)
Two-node InstanceThree-node InstanceRegionUnit Price (USD/Core/Hour)

Chengdu, Chongqing

0.03

Guangzhou, Shanghai, Beijing, Nanjing

0.04

Hong Kong, Tokyo, Seoul, Mumbai, Bangkok

0.0495Frankfurt, Sao Paulo

0.0365Singapore, Jakarta, Toronto, Silicon Valley, Virginia

0.061

RegionUnit Price (USD/Core/Hour)

Chengdu, Chongqing

0.06

Guangzhou, Shanghai, Beijing, Nanjing

0.08

Hong Kong, Tokyo, Seoul, Mumbai, Bangkok

0.099

Frankfurt, Sao Paulo

0.073

Singapore, Jakarta, Toronto, Silicon Valley, Virginia

0.122©2013-2022 Tencent Cloud. All rights reserved.

Page 99 of 461

TencentDB for MySQL

RegionUnit Price (USD/Core/Hour)

Chengdu, Chongqing

0.09

Guangzhou, Shanghai, Beijing, Nanjing

0.12

Hong Kong, Tokyo, Seoul, Mumbai, Bangkok

0.1485Frankfurt, Sao Paulo

0.1095Singapore, Jakarta, Toronto, Silicon Valley, Virginia

0.183©2013-2022 Tencent Cloud. All rights reserved.

Page 100 of 461

TencentDB for MySQL

FAQs：

Last updated 2023-12-27 10:30:48
This document gives FAQs related to the CPU Elastic Scaling feature.

Why can't I find the CPU Elastic Scaling feature in the console?
The CPU Elastic Scaling feature is only available for MySQL Universal Edition with two or three-node instances, or
single-node instances with local disks (read-only instance).You can check whether your instance is single-node (clouddisk) or dedicated version, as these types currently do not support the CPU Elastic Scaling feature.

During stress testing, why does the monitoring show that the CPU utilization remains at
100% even after the feature is enabled?
CPU utilization is calculated based on the actual number of CPU cores. If the service load fully utilizes all CPU
performance, performance-related metrics such as TPS, QPS, and response time of the database system should begiven attention.

Why does the CPU Elastic Scaling feature fail to be enabled?
There are two possible reasons for the failure to enable the CPU elastic scaling feature:
Your Tencent Cloud account does not have a sufficient balance.
The CPU resources on the host is insufficient (rarely occurs).
Ensure sufficient balance in your Tencent Cloud account or please submit a ticket for feedback.

Why am I not notified of events when the CPU is scaled-out or scaled-in?
You can troubleshoot and handle the issue as follows.
Check whether the alarm for CPU elastic scaling events has been enabled. If not, enable it by referring to Enabling
Event Alarms.
Check the notification recipient list; it is possible that no relevant users have been added. You can add the notification
recipient by referring to Adding Message Recipients.

What should I do if a HA switch occurs after the CPU Elastic Scaling feature is enabled?
The CPU Elastic Scaling feature will take effect simultaneously on both the primary and secondary nodes on two-nodeand three-node instances. If a HA switch occurs on a two-node or three-node instance after the CPU Elastic Scaling
feature takes effect, the switched node will also have the expanded CPU specification. When automatic scaling is
disabled or manual scaling is stopped, it will automatically restore to the original CPU specification. Please note thatfor read-only instances and disaster recovery instances, the feature need to be enabled separately. That means when
the CPU Elastic Scaling feature is enabled and takes effect on the primary instance, the read-only instances and©2013-2022 Tencent Cloud. All rights reserved.

Page 101 of 461

TencentDB for MySQL

disaster recovery instances attached to this primary instance will not expand their CPU specification simultaneously.
You need to enable the CPU elastic Scaling feature for them separately.

How can I query the progress and details related to CPU elastic scaling tasks?
You can query the progress and details related to CPU elastic scaling tasks through the task list, with the following
steps:
1. Log in to the TencentDB for MySQL console.
2. Choose Task List on the left sidebar, select the region, click Task Type, choose Configure Elastic Expansion
Strategy, and then click OK.
3. In the filtered task list, locate the target task to inquire about its progress. Click Task Details in the operation
column to view detailed task information.

Why am I continuously billed after the CPU Elastic Scaling feature is enabled?
If you choose manual scaling when enabling the feature, the scaling will continue until you manually stop it. Therefore,
after enabling manual scaling, please be sure to manually stop it based on your business requirements.
It is recommended to choose automatic scaling. After the configuration, the CPU specifications will be automaticallyand elastically scaled based on the user-configured scale-out and scale-in thresholds. Also, you will only be billed forthe number of cores scaled out when the scaling is successfully triggered. No fees are charged when there is no
scaling.

Within one hour after automatic scaling is enabled, it automatically scales in only 6 minutes
after scaling was triggered. Why am I being charged for 10 minutes?
To mitigate the impact of continuous intermittent peaks, there is a minimum protection period of 10 minutes during
automatic scaling. This means, if the automatic scaling lasts more than 10 minutes, the costs are calculated based on
the actual scaling duration. If the automatic scaling lasts for no more than 10 minutes, the costs are calculated basedon a 10-minute duration.

©2013-2022 Tencent Cloud. All rights reserved.

Page 102 of 461

TencentDB for MySQL

Read-Only/Disaster Recovery Instances
Creating Read-Only Instance：

Last updated 2024-07-30 14:59:21

Overview
TencentDB for MySQL allows you to create one or more read-only instances, which are suitable for read/write
separation and one-primary-multiple-replica application scenarios and capable of greatly enhancing the read load
capacity of your database.
Database proxy is supported. After creating a read-only instance, you can purchase the database proxy service toenable the read/write separation feature. Then, you can configure the database proxy address in your application soas to automatically forward write requests to the primary instances and read requests to the read-only instances.
Note:
For read-only instance pricing, see Product Pricing.
You can now configure a custom and exclusive private network address (IP and port) for a read-only instance on the
instance details page.

The deployment architecture of a Cluster Edition instance consists of 1 read-write node and up to 5 read-only nodes. If
you have purchased a Cluster Edition instance, see Adding a Node for an Instance and Deleting a Node for an
Instance for operations on adding or deleting read-only nodes. The Cluster Edition instance also supports adding 1 to
15 independent read-only instances. You can refer to the method described in this document for creation, and shouldnote that the independent read-only instances cannot be switched to read-write nodes.
Concepts
Read-only group: It consists of one or more load balancing-enabled read-only instances. If there are multiple read-only
instances in one read-only group, read request volume can be evenly distributed among the instances. Read-onlygroups provide IPs and ports for access to databases.
Read-only instance: A single-node (with no replica) instance that supports read requests. It cannot exist
independently; instead, it must be in a read-only group.
Architecture©2013-2022 Tencent Cloud. All rights reserved.

Page 103 of 461

TencentDB for MySQLThe MySQL primary-replica binlog sync feature is adopted for read-only instances, which can sync the changes in the
primary instances (source database) to all read-only instances. Given the single-node architecture (without a replica)of read-only instances, repeated attempts to restore a failing read-only instance will be made. Therefore, we
recommend that you choose an RO group over a read-only instance for higher availability.
Note:
If there is only one read-only instance in the read-only group, there will be risks with single points of failure, and thisgroup will not be included in the overall availability calculation of the TencentDB for MySQL service. A single read-only
instance does not provide SLA guarantee. We recommend you purchase at least two read-only instances to ensure
the availability of the read-only group.

Feature limits
Read-only instances cannot be created for single-node instances of the cloud disk edition.
Read-only instances can be purchased only for two-node or three-node or Cluster Edition primary instances
on MySQL 5.6 or later with the InnoDB engine at a specification of 1 GB memory and 50 GB disk capacity
or above. If your primary instance is below this specification, upgrade it first.
The minimum specification of a read-only instance is 1 GB memory and 50 GB disk capacity, which must be equal toor greater than the storage capacity purchased for the primary instance.

©2013-2022 Tencent Cloud. All rights reserved.

Page 104 of 461

TencentDB for MySQL

A two-node or three-node primary instance supports creating up to 5 read-only instances, and a Cluster Edition
instance supports creating up to 15 read-only instances.
A primary instance can create up to 5 read-only instances.
Backup and rollback features are not supported.
Data cannot be migrated to read-only instances.
Database creation/deletion is not supported and neither is phpMyAdmin (PMA).
Operations including account creation/deletion/authorization and account name/password modification are notsupported.

Use limits
There is no need to maintain accounts or databases for read-only instances, which are synchronized with those of the
primary instance.
If the MySQL version is 5.6 but GTID is not enabled, you need to enable GTID in the console first before creating aread-only instance.
The operation takes a long time, and the instance will be disconnected for several seconds. We recommend that you
do so during off-peak hours and add a reconnection mechanism in the programs that access the database.
Read-only instances only support the InnoDB engine.
Data inconsistency between multiple read-only instances may occur due to the delay in data sync between the readonly instances and the primary instance. You can check the delay in the console.
The specification of a read-only instance can be different from that of the primary instance, which makes it easier for
you to upgrade the read-only instance based on the load. We recommend that you keep the same specifications ofread-only instances in one RO group.

Directions
1. Log in to the TencentDB for MySQL console. In the instance list, click an instance ID or Manage in the Operation
column to access the instance details page.
2. Click Add Read-Only Instance in the Instance Architecture Diagram section on the Instance Details tab (add
an independent read-only instance for the Cluster Edition) or click Create on the Read-Only Instance tab.
3. On the displayed purchase page, specify the following read-only instance configurations, confirm that everything iscorrect, and click Buy Now.
Note:
If you need to unify the expiration time of the primary and read-only instances, you can set the collective expiration
date in the renewal management console as instructed in Renewal Management.

©2013-2022 Tencent Cloud. All rights reserved.

Page 105 of 461

TencentDB for MySQLThe newly added independent read-only instance for the Cluster Edition does not involve the operations related to
specifying RO groups.

Parameter

Description

Specify RO GroupYou can use the RO group automatically assigned by the system, create one, or
select an existing one.
Assigned by system: If multiple instances are purchased at a time, each of them will
be assigned to an independent RO group, and their weights will be automaticallyassigned by the system by default.
Create RO group: Create an RO group. If multiple instances are purchased at atime, all of them will be assigned to this new RO group, and their weights will beallocated by the system automatically by default.
Existing RO group: Specify an existing RO group. If multiple read-only instances arepurchased at a time, all of them will be assigned to the RO group. Their weights will

©2013-2022 Tencent Cloud. All rights reserved.

Page 106 of 461

TencentDB for MySQL

be allocated as configured in the RO group. If assignment by the system is set for
the RO group, the instances will be added to the group automatically according to
the purchased specifications. If custom allocation is set, their weights will be zero bydefault. As the same private IP is shared within an RO group, if a VPC is used, thesame security group settings will be shared. If an RO group is specified, it is notpossible to customize any security group when instances are purchased.
RO Group NameYou can set the name of the new RO group when creating it. The name can containup to 60 letters, digits, hyphens, underscores, and dots.
Select whether to enable the removal policy. If this option is enabled, you need toset **Delay Threshold** and **Least RO Instances**, and the weight of the removed
instances is automatically set to 0.

Remove Delayed RO
Instances

If a read-only instance is removed when its delay exceeds the threshold, it will
become inactive, its weight will be automatically set to 0, and alarms will be sent tocorresponding recipients. The instance will be put back into the RO group when its
delay falls below the threshold. For more information on how to configure the readonly instance removal alarm and recipients, see Alarm Policies (TCOP). No matter
whether delayed read-only instance removal is enabled, a read-only instance that isremoved due to instance failure will rejoin the RO group when it is repaired.

Billing Mode

Monthly subscription and pay-as-you-go billing are supported.

AZ

When creating a new RO group, you can select the same AZ as the primary
instance or a different AZ. There are no substantial differences between different
AZs. If you choose a different AZ, the RO group will reside across AZs and can
improve data disaster recovery, but there will be a few milliseconds of network
latency.

4. After the purchase is completed, you will be redirected to the instance list. When the status of the instance changes
to Running, it can be used normally.

FAQs
What are the rules for removing read-only instances?
After Remove Delayed RO Instances is enabled, the RO group will determine the removal rule based on the delay
threshold and "Least RO Instances" value. If the delay of a read-only instance reaches the threshold, it will be
removed and made inactive, with its weight set to 0 and an alarm sent to corresponding recipients. When its delay falls
below the threshold, it will be returned to the RO group.
Delay Threshold: Set a delay threshold for a read-only instance. When the threshold is exceeded, the instance will be
removed from the RO group.

©2013-2022 Tencent Cloud. All rights reserved.

Page 107 of 461

TencentDB for MySQL

Least RO Instances: This is the minimum number of instances that should be retained in the read-only group. When
there are fewer instances in the read-only group, even if an instance exceeds the delay threshold, it will not be
removed.
If read-only instances are terminated or returned, how will the primary instance be affected?
The termination and return of read-only instances has no impact on the primary instance.
Why can't I select a specific AZ when creating a read-only instance?
If you can't select an AZ, it means that there are no resources in this AZ. You can choose another AZ as displayed on
the actual purchase page, which will not affect your use of the read-only instance.
Can I select an AZ different from that of the primary instance when creating a read-only instance?
Yes. When creating a read-only instance, you can choose to create a new RO group for it and select an AZ different
from that of the primary instance. However, if you select an existing RO group, the AZ of the new read-only instancecan only be the same as that of the selected existing RO group, which may not necessarily be the same as that of the
primary instance.

©2013-2022 Tencent Cloud. All rights reserved.

Page 108 of 461

TencentDB for MySQLManaging the RO Group of Read-Only
Instance：

Last updated 2024-07-22 14:52:52

Overview
TencentDB for MySQL allows you to create one or more read-only instances to form an RO group, which is suitable
for read/write separation and one-source-multiple-replica application scenarios and capable of greatly enhancing theread load capacity of your database.
An RO group is a set of read-only instances sharing the same address. You can set their weights to balance the trafficload, set the policy of removing delayed read-only instances, and perform other configurations. You can deploy an RO
group as needed and send the corresponding read requests to read-only instances according to certain rules. In
addition, you can implement disaster recovery by configuring multiple read-only instances in the same RO group.

Prerequisites
A source instance must be created first before a read-only instance can be created. For more information, see
Creating MySQL Instance.

Creating an RO group
1. Log in to the TencentDB for MySQL console. In the instance list, click an instance ID or Manage in the Operation
column to enter the instance management page.
2. Click Add Read-Only Instance in the Instance Architecture Diagram section on the Instance Details tab or
click Create on the Read-Only Instance tab.

©2013-2022 Tencent Cloud. All rights reserved.

Page 109 of 461

TencentDB for MySQL

3. On the displayed purchase page, specify the following read-only instance configurations, confirm that everything iscorrect, and click Buy Now.
Specify RO Group: Select Create RO group. If multiple instances are purchased at a time, all of them will beassigned to this new RO group, and their weights will be automatically assigned by the system by default. - Assign
Read Weight: It is assigned by the system.
RO Group Name: The RO group name doesn't need to be unique and can contain up to 60 letters, digits, hyphens,
and underscores. - Instance Name: It must contain less than 60 letters, digits, or symbols (-_.).
Remove Delayed RO Instances: Select whether to enable the removal policy. If a read-only instance is removed, its
weight will be automatically set to 0.
If a read-only instance is removed when its delay exceeds the threshold, it will become inactive, its weight will be
automatically set to 0, and alarms will be sent to corresponding recipients. The instance will be put back into the RO
group when its delay falls below the threshold. For more information on how to configure the read-only instanceremoval alarm and recipients, see Alarm Policies (TCOP).
No matter whether delayed read-only instance removal is enabled, a read-only instance that is removed due toinstance failure will rejoin the RO group when it is repaired.
Delay Threshold: Set a delay threshold for the read-only instance. When the threshold is exceeded, the instance will
be removed from the RO group.
Least RO Instances: This is the minimum number of instances that should be retained in the RO group. When there
are fewer instances in the RO group, even if an instance exceeds the delay threshold, it will not be removed.

©2013-2022 Tencent Cloud. All rights reserved.

Page 110 of 461

TencentDB for MySQL

Assign Read Weight: It is assigned by the system.
Billing Mode: Monthly subscription and pay-as-you-go billing are supported.
Region: It is the same as that of the source instance by default.
Database Version: It is the same as that of the source instance by default.
Engine: It is the same as that of the source instance by default.
Architecture: Select Single-node. Although the single-node architecture is cost-effective, there is a single point of
failure for a single read-only instance. It is recommended to purchase at least two read-only instances in the service
RO group that requires availability.
Data Replication Mode: Async replication
AZ: When creating a new RO group, you can select the same AZ as the source instance or a different AZ. There areno substantial differences between different AZs. If you choose a different AZ, the RO group will reside across AZs
and can improve data disaster recovery, but there will be a few milliseconds of network latency.
For other configuration items, see Creating MySQL Instance.
4. Return to the instance list. The status of the created instance is Delivering. If the status changes to Running, theread-only instance has been successfully created.

Configuring an RO group
On the RO group configuration page, you can configure the basic information of the group such as ID, name, delayed
replication, replication delay, removal policy, delay threshold, least read-only instances, and read weight.
Note:
Read-only instances in an RO group can use different specifications, and their read traffic weights can be set.
Read-only instances in the same RO group can have different expiration dates and billing modes.
Once enabled, delayed replication will take effect for all read-only instances in this RO group, but won't change theirreplication statuses.
The replication delay option will appear only after delayed replication is enabled.
1. Log in to the TencentDB for MySQL console. In the instance list, click a source instance ID to enter the instancemanagement page.
2. On the instance management page, click the Read-Only Instance tab and click Configure in the RO Group
column to enter the RO group configuration page.

©2013-2022 Tencent Cloud. All rights reserved.

Page 111 of 461

TencentDB for MySQL

3. On the RO group configuration page, configure the RO group information and click OK.
You can set delayed replication and select to replay by flashbacked position or global transaction identifier (GTID)
during the delay to efficiently roll back data and fix failures.
Replication Delay: You can configure the time of delayed replication between a read-only instance and its source
instance. The value range is 1–259200 seconds.
Remove Delayed RO Instances: Select whether to enable the removal policy. If a read-only instance is removed, its
weight will be automatically set to 0. If a read-only instance is removed when its delay exceeds the threshold, it will
become inactive, alarms will be sent to corresponding recipients. For more information on how to configure the readonly instance removal alarm and recipients, see Alarm Policies (TCOP).
Delay Threshold: Set a delay threshold for the read-only instance. When the threshold is exceeded, the instance will
be removed from the RO group.
Least RO Instances: This is the minimum number of instances that should be retained in the RO group. When there
are fewer instances in the RO group, even if an instance exceeds the delay threshold, it will not be removed.
Assign Read Weight: The RO group supports two weight assignment methods: automatic assignment by the systemand custom assignment. The weight value must be an integer between 0 and 100. Below is the list of read weights
automatically set for two-node and three-node TencentDB for MySQL instances by the system:
MemorySpecification
(MB)

1000

2000

4000

8000

12000

16000

24000

32000

48000

6400

Weight

1

1

2

2

4

4

8

8

10

12

Rebalance:
If rebalance is disabled, modifying weight will take effect only for new loads but will not affect the read-only instances
accessed by existing persistent connections or cause a momentary disconnection from the database.
If rebalancing is enabled, all connections to the database will be temporarily disconnected, and the loads of newly
added connections will be balanced based on the set weights.

©2013-2022 Tencent Cloud. All rights reserved.

Page 112 of 461

TencentDB for MySQL

Terminating and deleting an RO group
Note:
RO groups cannot be deleted manually.
An RO group will be automatically deleted when the last read-only instance in it is eliminated.
Empty RO groups cannot be retained.
1. Log in to the TencentDB for MySQL console. In the instance list, click a source instance ID to enter the instancemanagement page.
2. On the instance management page, click the Read-Only Instance tab and click Terminate/Return or
Terminate/Return & Refundin the Operation column on the right.

3. In the pop-up window, read and agree to the Termination Rules and click Terminate Now.

FAQs
Why can't I select a specific AZ when creating a read-only instance?
If you can't select an AZ, it means that there are no resources in this AZ. You can choose another AZ as displayed on
the actual purchase page, which will not affect your use of the read-only instance.

©2013-2022 Tencent Cloud. All rights reserved.

Page 113 of 461

TencentDB for MySQLCan I select an AZ different from that of the source instance when creating a read-only instance?
Yes. When creating a read-only instance, you can choose to create a new RO group for it and select an AZ different
from that of the source instance. However, if you select an existing RO group, the AZ of the new read-only instancecan only be the same as that of the selected existing RO group, which may not necessarily be the same as that of thesource instance.

©2013-2022 Tencent Cloud. All rights reserved.

Page 114 of 461

TencentDB for MySQLManaging Delayed Replication of Read-Only
Instance：

Last updated 2024-07-22 14:53:12
This document describes how to set delayed replication for read-only instances and enable/disable replication in theTencentDB for MySQL console. You can set delayed replication (i.e., delay between a read-only instance and its
source instance) and select to replay by flashbacked position or global transaction identifier (GTID) during the delay toefficiently roll back data and fix failures.
Delayed Replication: you can enable and configure the replication delay between a read-only instance and its source
instance on its RO group configuration page or management page.
Enabling/Disabling Replication: you can manually enable or disable data sync between a read-only instance and its
source instance.

Delayed Replication Description
After delayed replication is enabled for a read-only instance, it will be removed from the RO group with its weight set to0, and a removal alarm will be triggered. At this point, the traffic will not be forwarded to the removed instance if the
RO VIP is used to access the RO group. What's more, the removed instance can only be accessed via the instance's
VIP.
After the delayed replication is disabled for a read-only instance ( the corresponding RO group has enabled delayedreplication-read-only-instance removal), the weight of this read-only instance in the RO group will be recovered only if
the delay time of this instance is less than the delay threshold of the RO group. And a restoration alarm will be
triggered at the same time.
During replay by flashbacked position, you cannot restart the instance, adjust its configuration, upgrade its version, or
upgrade its kernel minor version.

Enabling Delayed Replication
Note:
Delayed Replication is disabled for a read-only instance by default. If it is enabled, the delayed replication time will
be displayed.

Enabling on the read-only instance's RO group configuration page
1. Log in to the TencentDB for MySQL console. In the instance list, click a source instance ID to enter the instancemanagement page.

©2013-2022 Tencent Cloud. All rights reserved.

Page 115 of 461

TencentDB for MySQL

2. On the instance management page, select the Read-Only Instance tab, locate the desired RO group, and click
Configuration to enter the RO group configuration page.

3. On the RO group configuration page, enable Delayed Replication, set the Replication Delay, and click OK.
You can set delayed replication and select to replay by flashbacked position or global transaction identifier (GTID)
during the delay to efficiently roll back data and fix failures.
Replication Delay: You can configure the time of delayed replication between a read-only instance and its source
instance. The value range is 1–259200 seconds.
Remove Delayed RO Instances: This option indicates whether to enable the removal policy. If a read-only instanceis removed when its delay exceeds the threshold, its weight will be set to 0 automatically, and alarms will be sent (formore information on how to configure the read-only instance removal alarm and recipients, see Alarm Policies(TCOP)).
Delay Threshold: This sets a delay threshold for the read-only instance. When the threshold is exceeded, theinstance will be removed from the read-only group.
Least RO Instances: This is the minimum number of instances that should be retained in the RO group. When there
are fewer instances in the RO group, even if an instance exceeds the delay threshold, it will not be removed.
Assign Read Weight: The RO group supports two weight assignment methods: automatic assignment by the systemand custom assignment. The weight value must be an integer between 0 and 100.
Load Rebalancing:
Modifying weight will only affect new loads if rebalancing is disabled. The operation has no impact on read-only
instances accessed by existing persistent connections and does not cause momentary database disconnection.
If rebalancing is enabled, all connections to the database will be temporarily disconnected, and the loads of newly
added connections will be balanced according to the set weights.

©2013-2022 Tencent Cloud. All rights reserved.

Page 116 of 461

TencentDB for MySQL

Enabling on the read-only instance management page
1. Log in to the TencentDB for MySQL console. In the instance list, click a read-only instance ID or Manage in the
Operation column to access the read-only instance details page.
2. On the read-only instance details page, click Enable in Deployment Info > Delayed Replication.

©2013-2022 Tencent Cloud. All rights reserved.

Page 117 of 461

TencentDB for MySQL

3. In the pop-up window, set the delay and click OK.
Note:
The delay ranges from 1 to 259,200 seconds.
Read-Only instances in the same RO group share the same replication delay. If one instance is modified, the rest will
be modified automatically at the same time.

Modifying Delayed Replication
Modifying on the read-only instance's RO group configuration page©2013-2022 Tencent Cloud. All rights reserved.

Page 118 of 461

TencentDB for MySQL

1. Log in to the TencentDB for MySQL console. In the instance list, click a source instance ID to enter the instancemanagement page.
2. On the instance management page, select the Read-Only Instance tab, locate the desired RO group, and click
Configuration to enter the RO group configuration page.
3. On the RO group configuration page, modify Replication Delay and click OK.

Modifying on the read-only instance management page
1. Log in to the TencentDB for MySQL console and click a read-only instance ID in the instance list to enter the readonly instance details page.
2. On the read-only instance details page, click Modify in Deployment Info > Delayed Replication.

©2013-2022 Tencent Cloud. All rights reserved.

Page 119 of 461

TencentDB for MySQL

3. In the pop-up window, set the delay and click OK.

Disabling Delayed Replication
Disabling on the read-only instance's RO group configuration page
1. Log in to the TencentDB for MySQL console. In the instance list, click a source instance ID to enter the instancemanagement page.
2. On the instance management page, select the Read-Only Instance tab, locate the desired RO group, and click
Configuration to enter the RO group configuration page.
3. On the RO group configuration page, click Delayed Replication and click OK.

©2013-2022 Tencent Cloud. All rights reserved.

Page 120 of 461

TencentDB for MySQLDisabling on the read-only instance management page
1. Log in to the TencentDB for MySQL console and click a read-only instance ID in the instance list to enter the readonly instance details page.
2. On the read-only instance details page, click Disable in Deployment Info > Delayed Replication.

3. In the pop-up dialog box, confirm that everything is correct and click OK.
Note:
If delayed replication is disabled, the delayed replication time will be 0 seconds, that is, real-time data sync is resumed
between the read-only instance and its source instance. >Enabling Data Replication©2013-2022 Tencent Cloud. All rights reserved.

Page 121 of 461

TencentDB for MySQLNote:
The Replication Status of a read-only instance is Normal by default. If you set delayed replication and delete data
accidentally during the delayed replication time period, you can restore the read-only instance to the specified position
or GTID of the binlog file to implement quick data restoration.
1. Log in to the TencentDB for MySQL console and click a read-only instance ID in the instance list to enter the readonly instance details page.
2. On the read-only instance details page, click Enable in Deployment Info > Replication Status.

3. In the pop-up window, click OK.
Note:Once the replication is enabled, the data sync between the read-only instance and the source instance will resume.

4. You can also select Replay by Flashbacked Position in Deployment Info > Operation. Then, data can berestored to the specified time point or corresponding GTID. After the restoration, replication of the read-only instancewill be disabled until the start mode is switched to Replicate all.
Time: You can select a time point between the replication end time and the current time of the source instance.
GTID: You can select all logs after the binlog not applied. If GTID is selected, data will be replicated until the specified
GTID is reached.
The length of instance server_uuid is fixed at 36 bits, and the GTID must be inserver_uuid:transaction_id format.
Note:
If the entered binlog position has already been applied on the read-only instance or is after the source instanceposition, replication will fail to be enabled.
When you enable replication, if there is any breakpoint in the binlog, replication will fail to be enabled.

©2013-2022 Tencent Cloud. All rights reserved.

Page 122 of 461

TencentDB for MySQL

To avoid overusing the disk space of a delayed read-only instance when replication is disabled for it, the I/O thread of
the read-only instance will be paused when its available disk space drops below 5 GB.

5. During the process of replay by flashbacked position, you can click Replaying after Replication Status to queryand refresh the task details.

6. After the replication is completed, click Enable after Replication Status, and the read-only instance can continue
to replicate.

Disabling Data ReplicationNote:©2013-2022 Tencent Cloud. All rights reserved.

Page 123 of 461

TencentDB for MySQL

Only after delayed replication is enabled can it be disabled; otherwise, the Disable button is grayed out.
Once replication is disabled, I/O and SQL threads will also be ended.
1. Log in to the TencentDB for MySQL console and click a read-only instance ID in the instance list to enter the readonly instance details page.
2. On the read-only instance details page, click Disable in Deployment Info > Replication Status.

3. In the pop-up dialog box, confirm that everything is correct and click OK.

FAQs
How do I get the GTID?
We recommend you run the flush log command to get the binlog file to locate the position and GTID of themaloperation.
How do I view the delay?
You can view the delay between a read-only instance and its source instance on the instance details page in the
console.

©2013-2022 Tencent Cloud. All rights reserved.

Page 124 of 461

TencentDB for MySQLHow do I view the task information of replay by flashbacked position?
You can view the task progress and details on the task list page in the console.

©2013-2022 Tencent Cloud. All rights reserved.

Page 125 of 461

TencentDB for MySQLManaging Disaster Recovery Instance：

Last updated 2024-06-18 16:12:14

Overview
For applications with high requirements of service continuity, data reliability, and compliance, TencentDB for MySQL
provides cross-region disaster recovery instances to help enhance your capability to deliver continued services at low
costs and improve data reliability.
Note:
A disaster recovery instance costs the same as the source instance associated with it. For more information, see
Product Pricing.
Features
With a separate database connection address, a disaster recovery instance can offer read access capability forvarious scenarios such as nearby access and data analysis with lower costs of device redundancy.
Its highly available source/replica architecture helps avoid single points of failure for databases.
Data is synced over a private network with lower latency and higher stability compared to public network.
The traffic of data sync over the private network is currently free of charge during the promotion period. Start date ofcharging for commercial purpose is subject to further notice.
How it works
If a TencentDB instance is used as a disaster recovery database, this instance will be the backup of the source
instance.
When any change takes place in the source instance, the log information recording the change will be copied to thedisaster recovery instance and then data sync will be implemented through log replay.
If any failure occurs in the source instance, the disaster recovery instance can be activated in seconds to provide full
read/write capability.

Feature limits
Disaster recovery instances cannot be created for single-node instances of the cloud disk edition.
The primary instance can support up to 4 disaster recovery instances.
Only supports specifications of 1 GB memory, 50 GB hard disk and above, and MySQL 5.6 or later versions (MySQL
5.6 needs to submit the ticket to use this feature), and the primary instance of the InnoDB engine with high availability
edition can purchase disaster recovery instances. If the primary instance is below this specification, please upgrade it
first.

©2013-2022 Tencent Cloud. All rights reserved.

Page 126 of 461

TencentDB for MySQLThe minimum specification of a disaster recovery instance is 1 GB memory and 50 GB disk capacity and must be atleast 1.1 times the storage capacity used by the source instance.
Disaster recovery instance does not support the following features: transferring project, rollback, SQL operation,changing character set, account management, changing port, data import, rollback log, and read-only instance.

Creating a disaster recovery instance
1. Log in to the TencentDB for MySQL console. In the instance list, click an instance ID or Manage in the Operation
column to access the details page.
2. Make sure that the GTID feature is enabled by viewing the basic information of the instance on the Instance
Details page. Click Add Disaster Recovery Instance in the instance architecture diagram to enter the disasterrecovery instance purchase page.

3. On the purchase page, set basic information of the disaster recovery instance such as Billing Mode and Region.
Note:
The time required to complete the creation depends on the amount of data, and no operations can be performed on
the source instance in the console during the creation. We recommend you do so at an appropriate time.
If the sync policy is Sync Now, the data will be synced immediately when the disaster recovery instance is created.
Only the data of the entire instance can be synced. Make sure that the disk space is sufficient.
You need to ensure that the source instance is in the running state and none of configuration adjustment tasks, restarttasks, and other modification tasks are executed. Otherwise, the sync task may fail.

©2013-2022 Tencent Cloud. All rights reserved.

Page 127 of 461

TencentDB for MySQL

4. After confirming that everything is correct, click Buy Now and wait for the delivery of disaster recovery instance.
5. Return to the instance list. After the status of the instance changes to Running, it can be used normally.

Managing a disaster recovery instanceView a disaster recovery instanceA disaster recovery instance can be viewed from the region where it resides. You can use the instance list to filter out
all instances in a specific region.

View the relationship
Click the icon on the right of a disaster recovery instance or source instance to view their relationship.

View sync delay
View the sync delay between the source instance and the disaster recovery instance at the top of the Instance
Details page of the disaster recovery instance.

Disaster recovery instance features
A disaster recovery instance has various features, such as instance details, instance monitoring, databasemanagement, security group, and backup and restoration.

Promoting a disaster recovery instance to a source instance
You can promote a disaster recovery instance to source instance in the console as needed.

©2013-2022 Tencent Cloud. All rights reserved.

Page 128 of 461

TencentDB for MySQL

Note:
After the disaster recovery instance is promoted to source instance, it will replace the original one as the new source
instance to continue your business, and its access address will change. Therefore, you need to update the new
address for your business.
After the promotion, the sync link to the original source instance will be disconnected and cannot be reconnected. You
must exercise caution with this operation.
1. Log in to the TencentDB for MySQL console, click the ID of the disaster recovery instance to be promoted in the
instance list, and access the instance management page.
2. Click Promote to Source Instance in the top-right corner to promote the disaster recovery instance to source
instance. After the promotion, the sync link with the original source instance will be disconnected, so that the promoted
instance can get data write capability and full MySQL functionality.

©2013-2022 Tencent Cloud. All rights reserved.

Page 129 of 461

TencentDB for MySQL

Database Proxy
Overview：

Last updated 2024-02-23 10:18:00
This document introduces the related features of the TencentDB for MySQL database proxy.

Document Overview
Database Proxy

Description

Documented
Guidance

Database Proxy

Introducing the use cases of the database proxy,

Database Proxy

Overview

along with its proxy features and more.

Overview﻿

Use Limits

Introducing the use limits for database proxy andthe versions supported by various capabilities.

Use Limits﻿

Kernel Minor
Version Release

Introducing the viewing method and the update
history of the database proxy's minor kernel

Kernel Minor
Version Release

Notes

version.

Notes﻿

Upgrading Kernel

Certain features require a higher kernel version
for the database proxy. In instances where it isUpgrading Kernel

Overview

KernelFeatures

Minor Version of
Database Proxynot sufficient, you can obtain methods on how to
upgrade the kernel version from this document.

Minor Version of
Database Proxy﻿Managing

Enabling Database

Introducing the prerequisites, use limits, andEnabling Database

Database
Proxy

Proxy

directions of the database proxy.

Proxy﻿

Setting Database

Introducing how to modify, add, or delete

Setting Database

Proxy Access
Address

database proxy access addresses after
activating the database proxy.

Proxy Access
Address﻿Viewing andIntroducing how to view and modify the accessViewing andModifying AccessPolicypolicy of the database proxy access address
after activating the database proxy.

Modifying AccessPolicy﻿Adjusting
Database Proxy
Configuration

Introducing the operations involved in adjusting
the proxy configuration (nodespecifications/quantity, availability zone) after

Adjusting Database
Proxy Configuration

activating the database proxy.

©2013-2022 Tencent Cloud. All rights reserved.

Page 130 of 461

TencentDB for MySQL

SwitchingIntroducing the procedure of altering the network

Switching

Database Proxy
Network

connection address of the database proxy after
activating the database proxy.

Database Proxy
Network﻿Viewing Database

Introducing how to view each database proxynode's connections, requests, CPU usage,

Viewing Database

Proxy MonitoringDatamemory usage, and more after activating thedatabase proxy.

Proxy Monitoring
Data﻿

Introducing the manual operation of Cloud Load
Load Rebalancing

Balancer when there is an imbalance of load
after activating the database proxy on each

Load Rebalancing﻿proxy node.
Disabling Database
Proxy

Introducing the procedure for disabling thedatabase proxy.

Disabling Database
Proxy﻿

Transaction Split Feature

Introducing the transaction split feature of thedatabase proxy.

Transaction Split
Feature﻿Momentary Disconnection

Introducing the momentary disconnection

Prevention Feature

prevention feature of the database proxy.

Automatic
Read/Write
Automatic
Read/Write
Separation
FeatureConnection
Pool
FeatureFeatures

Disconnection
Prevention Feature﻿
Automatic
Read/Write

Separation
Overviewfeature of the database proxy.

Separation
Overview﻿

Configuring

Introducing the procedures for configuring theConfiguring

Database Proxy
Read-Write

read/write attributes of the database proxyconnection address after activating the database

Database Proxy
Read-Write

Attributes

proxy.

Attributes﻿

Connection Pool
Overview

Introducing the connection pool feature of
database proxy.

Connection Pool
Overview﻿

Enabling andDisabling theIntroducing how to enable and disable theEnabling andDisabling theConnection Pool
FeatureOther

Introducing the automatic read/write separation

Momentary

Hint Syntax Usage

connection pool feature after activating thedatabase proxy.
Introducing the Hint syntax usage in the
database proxy.

©2013-2022 Tencent Cloud. All rights reserved.

Connection Pool
Feature﻿Hint Syntax Usage﻿

Page 131 of 461

TencentDB for MySQL

Overview
Database Proxy Overview：

Last updated 2024-07-22 14:56:11
This document describes the new version of the TencentDB for MySQL database proxy.
Database proxy is a network proxy service between the TencentDB service and the application service. It is used toproxy all requests when the application service accesses the database.
The database proxy access address is independent of the original database access address. Requests arriving at theproxy address are all relayed through the proxy cluster to access the source and replica nodes of the database.
Read/Write requests are separated, so that read requests are forwarded to read-only instances, which lowers the loadof the source database. This implements high availability, high performance, and Ops support.
TencentDB for MySQL database proxy also provides advanced features such as automatic read/write separation,transaction split, connection pool, cross-AZ read-only instance mounting, and enabling multiple proxy addresses.

Billing
Currently, database proxy is in beta test free of charge.

Use cases
Businesses with low performance when there is a large number of non-persistent connections.
Businesses that use multiple read-only instances with read/write separation is implemented manually on applications,
resulting in higher maintenance costs and risks.
High instance loading caused by too many connections.
High source instance load due to a large number of requests in the transaction.
Businesses that need to be assigned different loads through the access address.
Nearby access in cross-AZ deployment for reduced latency.

Read-write attribute
Each database proxy address can have its own read-write attribute.
Read/Write: Supports read/write separation to implement linear business scaling.
This attribute contains at least one source instance and one read-only instance, and write requests are sent to the©2013-2022 Tencent Cloud. All rights reserved.

Page 132 of 461

TencentDB for MySQL

source instance only. It supports read/write separation features such as transaction split and connection pool as wellas policies such as Remove Delayed RO Instances, Least RO Instances, and Failover.
Read-Only: Supports read-only businesses like reports.
This attribute contains at least one read-only instance, and the source instance is not involved in routing. It supports
features such as transaction split and connection pool as well as policies such as Remove Delayed RO Instancesand Least RO Instances.

Features
High stability
The database proxy is deployed in the cluster architecture, with multiple nodes ensuring smooth failover.
High availability
The database proxy adopts cross-AZ deployment to improve its availability.
Strong isolation
The database proxy provides the proxy service for the current instance with independent resources. The resources ofeach proxy are isolated and not shared.
Ultra-high performance
Each proxy can process up to 100,000 requests per second.
Convenient and fast scaling
You can dynamically add 1–60 proxy nodes, with only 6 nodes supported during the beta test.
Comprehensive performance monitoring
Performance metrics are monitored at the second level, such as the number of read/write requests, CPU, andmemory. The number of proxies can be adjusted according to the monitoring data as described in Viewing Database
Proxy Monitoring Data and business planning.
Hot reload
If the source instance is switched, has configuration adjustment, or has read-only instances added or removed, thedatabase proxy can dynamically hot load the configuration without causing network disconnections or restarts.
Automatic read/write separation
Enabling the read/write attribute of the database proxy address can effectively reduce the read load of the source
instance. Read-only instances can be added to horizontally scale the database cluster and automatically implement
read/write separation, which eliminates the complexity of manually separating read and write requests of the business.
This is especially suitable for scenarios with a high read load.
For example, only one proxy connection address needs to be configured in the application (when Read-Write
Attribute is set to Read/Write Separation), and this address will automatically implement read/write separation andsend read requests to read-only instances and write requests to the source instance. Even if you add or remove readonly instances, you don't need to adjust the application settings.

©2013-2022 Tencent Cloud. All rights reserved.

Page 133 of 461

TencentDB for MySQL

Connection poolThis feature can mitigate excessively high instance loads caused by too many connections or frequent newconnections in non-persistent connection businesses.
Transaction split
This feature separates reads and writes in one transaction to different instances for execution and forwards readrequests to read-only instances to reduce the load of the source instance.

Feature page©2013-2022 Tencent Cloud. All rights reserved.

Page 134 of 461

TencentDB for MySQL

Use Limits：

Last updated 2024-07-22 14:56:35
This document describes the use limits for the TencentDB for MySQL database proxy.
When using the proxy connection address, if you don't enable transaction split, transaction requests will be routed tothe source instance.
The database proxy supports cross-AZ configuration. The number of selectable AZs depends on how many AZs areavailable in the current region. You can select up to three AZs. If only one AZ can be selected, there is only one
available AZ in the region.
You can create multiple database proxy addresses, the number of which is the same as that of proxy nodes.
When a proxy connection address is used to implement read/write separation, the consistency of non-transactional
reads is not guaranteed. If your business requires read consistency, you can encapsulate it into transactions or use
the hint syntax.
When a proxy connection address is used, show processlist will merge the results of all nodes before
returning them.
For the PREPARE statement, the database proxy will first send PREPARE to all nodes. When a subsequentEXECUTE request comes in, it will determine the execution route according to the prepared statement type. For
example, if a write statement is prepared, it will send the statement to the source database during execution, and if a
non-transactional read statement is prepared, it will send the statement to a read-only instance.
After a business connection arrives at the database proxy, the proxy will connect to the source instance and all
configured read-only instances. The proxy itself does not have a limit on the maximum number of connections, which
is mainly subject to the maximum number of connections of the backend database instance. The smallest value of thisparameter of the source and read-only instances will affect the business performance.
After the database proxy is enabled, when a read-only instance is added or restarted, only new connection requests
will be routed to it. You can view the performance metrics of each proxy node through the overview or performancemonitoring as described in Viewing Database Proxy Monitoring Data. If you find that the numbers of connections on
the nodes are unbalanced, you can distribute the connections through rebalancing.
Versions supported for different database proxy capabilities:
Cross-AZ configuration: Proxy v1.3.1 or later.
Connection persistence timeout: Proxy v1.2.1 or later.
Connection pool: Proxy v1.2.1 or later.
Transaction split: Proxy v1.3.1 or later.
Connection address adding: Proxy v1.3.1 or later.
Note:
For more information on how to upgrade the proxy, see Upgrading Kernel Minor Version of Database Proxy.

©2013-2022 Tencent Cloud. All rights reserved.

Page 135 of 461

TencentDB for MySQL

Database Proxy Kernel Features
Kernel Minor Version Release Notes：

Last updated 2024-07-22 14:57:27
This document describes the kernel version updates of the TencentDB for MySQL database proxy.

Viewing the database proxy version
You can view the version in Overview > Proxy Version on the Database Proxy tab.

Version upgrade description
Note:
For more information on the kernel version updates of the TencentDB for MySQL database proxy, see Kernel Version
Release Notes > Database Kernel Version Release Notes.
If the MySQL kernel version requirements are not met, you can upgrade the kernel version of your database first as
instructed in Upgrading Kernel Minor Version.

©2013-2022 Tencent Cloud. All rights reserved.

Page 136 of 461

TencentDB for MySQL

Upgrading Kernel Minor Version of Database
Proxy：

Last updated 2024-07-22 14:57:50
This document describes how to manually upgrade the kernel minor version of the database proxy in the console.

Prerequisite
You have enabled the database proxy. For more information, see Enabling Database Proxy.

Notes
There will be a momentary disconnection when you upgrade the kernel minor version of the database proxy.
Therefore, upgrade the version during off-peak hours and make sure that your application has an automaticreconnection mechanism.
If the upgrade fails, the reason may be that the kernel minor version of the database is earlier than 20211031. You
need to upgrade the kernel minor version of the database before upgrading the kernel version of the database proxy.
For more information, see Upgrading Kernel Minor Version

Directions
1. Log in to the TencentDB for MySQL console. Select the region at the top and click the target instance ID to enter
the instance management page.
2. On the instance management page, select the Database Proxy tab.
3. In Overview > Basic Info > Proxy Version on the Database Proxy tab, click Upgrade Kernel Minor Version.

©2013-2022 Tencent Cloud. All rights reserved.

Page 137 of 461

TencentDB for MySQL

4. In the pop-up window, check the target version and select the upgrade switch time. After confirming that everythingis correct, click OK.
Switch Time:
During maintenance time: The upgrade will be performed during the maintenance time, which can be modified on the
instance details page.
Upon upgrade completion: The upgrade will be performed immediately after the upgrade operation is confirmed.
Note:
There will be a momentary disconnection during upgrade. Therefore, make sure that your business has areconnection mechanism.
Except for abnormal nodes, all nodes are upgraded at the same time by default during the kernel minor version
upgrade.

©2013-2022 Tencent Cloud. All rights reserved.

Page 138 of 461

TencentDB for MySQL©2013-2022 Tencent Cloud. All rights reserved.

Page 139 of 461

TencentDB for MySQL

Database Proxy Management
Enabling Database Proxy：

Last updated 2023-09-13 15:50:55
This document describes how to enable database proxy in the TencentDB for MySQL console.
Database proxy is a network proxy service between the TencentDB service and the application service. It is used toproxy all requests when the application service accesses the database. It provides advanced features such as
automatic read/write separation, connection pool, and connection persistence and boasts high availability, highperformance, Ops support, and ease of use.

Prerequisite
The instance is running on the two-node or three-node architecture.

Note
Database proxy currently is supported in the following regions:
Beijing (except Zones 1, 2, and 4), Shanghai (except Zone 1), Guangzhou (except Zones 1 and 2), Shanghai Finance(except Zones 1 and 2), Beijing Finance, Chengdu, Chongqing, Nanjing, and Hong Kong (China) (except Zone 1).
Tokyo (except Zone 1), Bangkok (except Zone 1), Virginia (except Zone 1), Silicon Valley (except Zone 1), Mumbai(except Zone 1), Seoul (except Zone 1), and Singapore (except Zones 1 and 2).
Database proxy currently is supported on the following versions: two-node and three-node MySQL 5.7 (with kernel
minor version 20211030 or later) and three-node MySQL 8.0 (with kernel minor version 20211202 or later). If you
upgrade the kernel minor version of the source instance, the associated read-only and disaster recovery instances will
be upgraded at the same time. For more information, see Upgrading Kernel Minor Version.

Directions
1. Log in to the TencentDB for MySQL console. In the instance list, select the source instance for which to enabledatabase proxy and click its ID or Manage in the Operation column to enter the instance management page.
2. On the instance management page, select the Database Proxy tab and click Enable Now.

©2013-2022 Tencent Cloud. All rights reserved.

Page 140 of 461

TencentDB for MySQL

3. In the pop-up window, configure the following items and click OK.

©2013-2022 Tencent Cloud. All rights reserved.

Page 141 of 461

TencentDB for MySQLParameter

Description

Network

Select the network of the database proxy, which can only be a VPC.

Proxy Specification

Select 2-core 4000 MB memory, 4-core 8000 MB memory, or 8-core 16000 MB memory.

©2013-2022 Tencent Cloud. All rights reserved.

Page 142 of 461

TencentDB for MySQLAZ and Node
Quantity

1. Select the database proxy AZ. You can click Add AZ to add more AZs. The number of
selectable AZs depends on how many AZs are available in the current region. You canselect up to three AZs.
2. Select the number of nodes. We recommend that you set the quantity to 1/8 (roundedup) of the total number of CPU cores on the source and read-only instances; for example,
if the source instance has 4 CPU cores, and the read-only instance has 8 CPU cores,
then the recommended node quantity will be (4 + 8) / 8 ≈ 2.
Note
If the selected proxy and the source instance are not in the same AZ and you access theinstance through the proxy, the write performance may be reduced.
If the recommended number of proxy nodes you calculated exceeds the maximum
purchasable quantity, choose a higher proxy node specification.

The security group of the source instance is selected by default. You can also selectSecurity groupanother existing security group or create a new one as needed.
Note
To access through the database proxy, you need to configure security group policies andopen the private port (3306).
For more information, see TencentDB Security Group Management.

Remarks(Optional) Enter the remarks of the database proxy service to be enabled.

4. After successfully enabling the service, you can manage proxy nodes and view their basic information on the
database proxy page. You can also modify the access address, network type, and remarks of the database proxy,
view and adjust the connection configuration, and perform rebalance in the Connection Address section.
Note
You can view Connections in the proxy node list or view the performance monitoring data of each proxy node tocheck whether the numbers of connections on the nodes are unbalanced, and if so, you can distribute the connections
by clicking Rebalance.
Rebalance will cause proxy nodes to restart, and the service will become unavailable momentarily during the restart.
We recommend that you restart the service during off-peak hours. Make sure that your business has a reconnection
mechanism.

©2013-2022 Tencent Cloud. All rights reserved.

Page 143 of 461

TencentDB for MySQL©2013-2022 Tencent Cloud. All rights reserved.

Page 144 of 461

TencentDB for MySQL

Setting Database Proxy Access Address：

Last updated 2024-07-22 15:16:55
This document describes how to set the database proxy connection address in the TencentDB for MySQL console.
The database proxy connection address is independent of the original database connection address. Requests
proxied at the proxy address are all relayed through the proxy cluster to the source and replica nodes of the database,so that read and write requests are separated, with reads being forwarded to read-only instances. In this way, the loadof the source database is lowered.
After database proxy is enabled for TencentDB for MySQL, a database proxy connection address will be added bydefault, and you can also add, modify, or delete the connection address for database proxy.

Prerequisites
You have enabled the database proxy. For more information, see Enabling Database Proxy.

Modifying Database Proxy Connection Address
1. Log in to the TencentDB for MySQL console. In the instance list, click an instance ID or Manage in the Operation
column of the instance with the proxy enabled to enter the instance management page.
2. On the instance management page, select the Database Proxy tab and click theicon next to Private Network Access Address on the Connection Address tab.

©2013-2022 Tencent Cloud. All rights reserved.

Page 145 of 461

TencentDB for MySQL

3. In the pop-up dialog box, modify the proxy address and click OK.
Note:
Modifying the proxy address affects the database business being accessed. We recommend you modify the address
during off-peak hours. Make sure that your business has a reconnection mechanism.

Adding Database Proxy Connection Address
Note:
The number of connection addresses is the same as that of database proxy nodes.
An connection address will be created by default when the database proxy is enabled.
1. Log in to the TencentDB for MySQL console. In the instance list, click an instance ID or Manage in the Operation
column of the instance with the proxy enabled to enter the instance management page.

©2013-2022 Tencent Cloud. All rights reserved.

Page 146 of 461

TencentDB for MySQL

2. On the instance management page, select the Database Proxy tab, and click Add Access Address next toConnection Address.

3. In the Create Connection window, set the following configuration items and click OK.
Step 1. Configure a network
Parameter
Network

Securitygroup

Remarks

Description
Database proxy only supports VPC. You can choose to automatically assign or specify anaddress.
The security group of the source instance is selected by default. You can also select another ormore existing security groups or create a new one as needed.
Note：

To access through the database proxy, you need to configure security group policies and open
the private port (3306). For more information, see TencentDB Security Group Management.
Optional. You can add remarks for the new database proxy connection address.

Step 2: Configure a policy
Parameter

Description

Read-Write
Attribute

Select the read-write attribute of the proxy access address, which can be Read/Write
Separation or Read-Only.
Set the Remove Delayed RO Instances policy. After this option is enabled, you can set

Remove Delayed
RO Instances

Delay Threshold and Least RO Instances. The system will try removing or restoring afailed read-only instance no matter whether this option is enabled.
Delay Threshold: Enter an integer greater than or equal to 1 (in seconds).
Least RO Instances: It is subject to the number of read-only instances owned by thesource instance. If it is set to `0`, when all read-only nodes are removed, all read requests
will be routed to the source instance until at least one of the removed read-only instances
rejoins the database proxy to continue processing the read requests.

Connection Pool

The connection pool feature mainly mitigates the instance load caused by frequent new

Statusconnections in non-persistent connection business scenarios. After this option is enabled,©2013-2022 Tencent Cloud. All rights reserved.

Page 147 of 461

TencentDB for MySQL

you can select the supported connection pool type, which currently can only be thesession-level connection pool by default.

Transaction Split

You can set whether to enable this feature. After it is enabled, reads and writes in one
transaction will be separated to different instances for execution, and read requests will
be forwarded to read-only instances to reduce the load of the source instance.

Assign Read
WeightYou can select Assigned by system or Custom. If multiple AZs are configured when the
database proxy is enabled, you can separately assign the weights of proxy nodes indifferent AZs.

Failover (with
Read-Write
Attribute being
Read/Write
Separation)

You can set whether to enable this feature. After it is enabled, if database proxy fails, thedatabase proxy address will route requests to the source instance.

Apply to Newly
Added RO
Instances

You can set whether to enable this feature. After it is enabled, a newly purchased readonly instance will be automatically added to the database proxy.
If Assign Read Weight is set to Assigned by system, newly purchased read-only
instances will be assigned with the default weight based on their specification.
If Assign Read Weight is set to Custom, when newly purchased read-only instances areadded, their weights will be 0 by default, which can be modified by clicking Adjust
Configurations in Connection Address on the Database Proxy tab.

Deleting Database Proxy Connection Address
Note:
If your database proxy has multiple connection addresses, you can delete unnecessary ones while keeping the lastone.
1. Log in to the TencentDB for MySQL console. In the instance list, click an instance ID or Manage in the Operation
column of the instance with the proxy enabled to enter the instance management page.
2. On the instance management page, find the target address in Database Proxy > Connection Address, and click
Disable.

©2013-2022 Tencent Cloud. All rights reserved.

Page 148 of 461

TencentDB for MySQL

3. In the pop-up window, click OK.

©2013-2022 Tencent Cloud. All rights reserved.

Page 149 of 461

TencentDB for MySQL

Viewing and Modifying Access Policy：

Last updated 2024-07-22 15:17:17
After database proxy is enabled for TencentDB for MySQL, a database proxy connection address will be added bydefault. You can also add connection addresses later to implement different business logics. The number ofconnection addresses that can be created is the same as that of database proxy nodes. You can view and modify theaccess policy of a connection address in the console.

Prerequisites
You have enabled the database proxy. For more information, see Enabling Database Proxy.

Viewing the access policy
1. Log in to the TencentDB for MySQL console, select the region at the top of the page, and click the ID of the target
instance to enter the instance management page.
2. On the instance management page, select Database Proxy > Access Policy.

Modifying the access policy©2013-2022 Tencent Cloud. All rights reserved.

Page 150 of 461

TencentDB for MySQL

1. Log in to the TencentDB for MySQL console, select the region at the top of the page, and click the ID of the target
instance to enter the instance management page.
2. On the instance management page, select Database Proxy > Access Policy, find the target access policy, andclick Settings.
Note:
You can also find the target access address in Database Proxy > Overview > Connection Address. Then, click
Adjust Configurations in the Operation column.
3. In the pop-up window, modify the policy configuration and click OK.

Parameter

Description

Read-Write Attribute

Modify the read-write attribute of the proxy access address, which can be
Read/Write Separation or Read-Only.

©2013-2022 Tencent Cloud. All rights reserved.

Page 151 of 461

TencentDB for MySQL

Remove Delayed RO Instances

Set the Remove Delayed RO Instances policy. After this option is enabled,
you can set Delay Threshold and Least RO Instances. The system will try
removing or restoring a failed read-only instance no matter whether thisoption is enabled.
Delay Threshold: Enter an integer greater than or equal to 1 (in seconds).
Least RO Instances: It is subject to the number of read-only instances
owned by the source instance. If it is set to `0`, when all read-only nodes
are removed, all read requests will be routed to the source instance until atleast one of the removed read-only instances rejoins the database proxy tocontinue processing the read requests.
The connection pool feature mainly mitigates the instance load caused byfrequent new connections in non-persistent connection businessConnection Pool Statusscenarios. After this option is enabled, you can select the supported
connection pool type, which currently can only be the session-level
connection pool by default.
You can set whether to enable this feature. After it is enabled, reads andTransaction Split

writes in one transaction will be separated to different instances for
execution, and read requests will be forwarded to read-only instances toreduce the load of the source instance.
You can select Assigned by system or Custom. If multiple AZs are

Assign Read Weight

configured when the database proxy is enabled, you can separately assign
the weights of proxy nodes in different AZs.

Failover (with Read-Write
Attribute being Read/Write

You can set whether to enable this feature. After it is enabled, if databaseproxy fails, the database proxy address will route requests to the source

Separation)

instance.
You can set whether to enable this feature. After it is enabled, a newly
purchased read-only instance will be automatically added to the databaseproxy.

Apply to Newly Added RO
Instances

If Assign Read Weight is set to Assigned by system, newly purchased
read-only instances will be assigned with the default weight based on their
specification.
If Assign Read Weight is set to Custom, when newly purchased read-only
instances are added, their weights will be 0 by default, which can be
modified by clicking Adjust Configurations in Connection Address on the
Database Proxy tab.

©2013-2022 Tencent Cloud. All rights reserved.

Page 152 of 461

TencentDB for MySQL

Adjusting Database Proxy Configuration：

Last updated 2024-07-22 15:17:32
This document describes how to adjust the database proxy configuration in the console, including the proxyspecification, AZ, and node quantity.

Prerequisites
You have enabled the database proxy. For more information, see Enabling Database Proxy.

Notes
The database proxy will be automatically upgraded to the latest version during configuration adjustment if its version is
old.
If the selected proxy and the source instance are not in the same AZ and you access the instance through the proxy,
the write performance will be reduced.
If the recommended number of proxy nodes you calculated exceeds the maximum purchasable quantity, choose ahigher proxy node specification.
If resources are sufficient in the region, you can select up to three AZs and need to retain at least one AZ (the one in
the first row).

Impact description
Changing different configuration items has different impacts, some of which will not cause a momentary disconnection,
while some will. The specific change items and their impacts are as detailed below:
Scenario 1: Changing the proxy specification but not AZ or node quantity
Proxy
Specification
Upgrade or
downgrade

AZ

Node
Quantity

Load
Balancing
Mode

Unchanged

Unchanged

Automatic

Switch Time

ImpactDuringmaintenance
time

There will be a momentary
disconnection lasting seconds.
Make sure that your businesshas a reconnection
mechanism.

Upon
upgrade©2013-2022 Tencent Cloud. All rights reserved.

Page 153 of 461

TencentDB for MySQL

completion
Duringmaintenance
time
ManualUpon
upgradecompletion

Scenario 2: Changing the node quantity but not proxy specification or AZ
ProxySpecification

AZ

Node
Quantity

Load
BalancingMode

Switch Time

ImpactDuringmaintenancetime
AutomaticUpon
upgradecompletion

Increased

ManualUnchanged-

There will be a momentary
disconnection lasting seconds.
Make sure that your businesshas a reconnection mechanism.

There will be no momentary
disconnections.

Duringmaintenancetime

Unchanged
AutomaticUpon
upgradecompletion
Decreased
Duringmaintenance

There will be a momentary
disconnection lasting seconds.
Make sure that your businesshas a reconnection mechanism.

time
ManualUpon
upgradecompletion

Scenario 3: Changing the AZ and node quantity but not proxy specification
Proxy
Specification

AZ

Node

Load

Quantity

Balancing©2013-2022 Tencent Cloud. All rights reserved.

Switch Time

ImpactPage 154 of 461

TencentDB for MySQL

Mode
Unchanged

Duringmaintenancetime
AutomaticUpon
upgradeIncreased

There will be a momentary
disconnection lasting seconds.
Make sure that your businesshas a reconnection mechanism.

completion
ManualIncreased-

There will be no momentary
disconnections.

Duringmaintenance

There will be a momentary
disconnection lasting seconds.

time

Make sure that your businesshas a reconnection mechanism.

AutomaticUpon
upgradecompletion
Decreased
Duringmaintenance
time
ManualUpon
upgradecompletion
Decreased

Duringmaintenancetime
AutomaticUpon
upgradecompletion
Increased
Duringmaintenance
time
ManualUpon
upgradecompletion
Decreased

Automatic

Duringmaintenancetime©2013-2022 Tencent Cloud. All rights reserved.

Page 155 of 461

TencentDB for MySQL

Upon
upgradecompletion
Duringmaintenance
time
ManualUpon
upgradecompletion
Duringmaintenancetime
AutomaticUpon
upgradecompletion
Increased
Duringmaintenance
time
ManualUpon
upgradecompletion
ChangedDuringmaintenancetime
AutomaticUpon
upgradecompletion
Decreased
Duringmaintenance
time
ManualUpon
upgradecompletion

Directions©2013-2022 Tencent Cloud. All rights reserved.

Page 156 of 461

TencentDB for MySQL

1. Log in to the TencentDB for MySQL console, select the region at the top of the page, and click the ID of the target
instance to enter the instance management page.
2. On the instance management page, select the Database Proxy tab.
3. On the Overview tab on the Database Proxy tab, select Basic Info > Node Quantity and click Adjust
Configurations.

4. In the pop-up window, modify the proxy specification, AZ, and node quantity of the database proxy as needed andclick OK.

©2013-2022 Tencent Cloud. All rights reserved.

Page 157 of 461

TencentDB for MySQL

5. In Basic Info on the Database Proxy tab, after the task status changes from Upgrading to Running, theconfiguration adjustment is completed.
Note:
If you select Upon upgrade completion, after the configuration is adjusted, the system will automatically switch to
the new configuration.
If you select During maintenance time, after the configuration is adjusted, the system will switch the configuration
during the specified maintenance time period.
If you select During maintenance time but need to switch the configuration earlier due to your business
requirements, after the configuration is adjusted, you can go to Database Proxy > Overview > Basic Info >Status/Task and click Complete Now after Waiting for switch (after upgrade).

©2013-2022 Tencent Cloud. All rights reserved.

Page 158 of 461

TencentDB for MySQL

If you select manual rebalance after the configuration adjustment, perform the operation in Overview > Connection
Address on the Database Proxy tab after the configuration is adjusted.

©2013-2022 Tencent Cloud. All rights reserved.

Page 159 of 461

TencentDB for MySQL

Switching Database Proxy Network：

Last updated 2024-07-22 15:17:44
This document describes how to switch the database proxy network in the TencentDB for MySQL console.

Prerequisites
You have enabled the database proxy. For more information, see Enabling Database Proxy.

Notes
Switching the network may cause the change of the instance database proxy IP. The old IP will be retained for 24hours by default and up to 168 hours. Then, it will become invalid. Therefore, modify the IP on the client promptly.
If Valid Hours of Old IP is set to 0 hours, the IP is released immediately after the network is changed.
You can only select a VPC in the region of the MySQL instance, but you can choose a subnet in any AZ and view its
IP range.
When you add multiple access addresses for the database proxy, you can set and modify the network for each ofthem.

Directions
1. Log in to the TencentDB for MySQL console. Select a region on the top, and click the instance ID to enter the
instance management page.
2. On the instance management page, select the Database Proxy tab.
3. On the Database Proxy tab, clickunder Overview > Connection Address > Network.

©2013-2022 Tencent Cloud. All rights reserved.

Page 160 of 461

TencentDB for MySQL

4. In the pop-up dialog box, select a new network and click OK.

©2013-2022 Tencent Cloud. All rights reserved.

Page 161 of 461

TencentDB for MySQL

Set Valid Hours of Old IP to 0–168 hours.
Select Auto-Assign IP or Specify IP.
5. After successfully changing the network, you can view the new network under Connection Address.

©2013-2022 Tencent Cloud. All rights reserved.

Page 162 of 461

TencentDB for MySQL

Viewing Database Proxy Monitoring Data：

Last updated 2024-07-22 15:17:58
This document describes how to view database proxy node monitoring data in the TencentDB for MySQL console.

Prerequisites
You have enabled the database proxy. For more information, see Enabling Database Proxy.

Supported Monitoring Metrics
Metric Name

Unit

Description

Current connections

Count

Current node connections

Requests

Count/sec

Node access requests

Read requests

Count/sec

Read operation requests

Write requests

Count/sec

Write operation requests

CPU utilization%

CPU utilization

Memory utilization%

Memory utilization

Memory usage

MB

Used memory

Directions
Option 1:
1. Log in to the TencentDB for MySQL console. In the instance list, click the ID or Manage in the Operation columnof the source instance with proxy enabled to enter the instance management page.
2. On the instance management page, select Database Proxy > Performance Monitoring page, and click a proxynode name to view its monitoring data. You can switch between different nodes by clicking their names.
Note:
The default granularity of monitoring within four hours is 5 seconds.

©2013-2022 Tencent Cloud. All rights reserved.

Page 163 of 461

TencentDB for MySQL

Option 2:
1. Log in to the TencentDB for MySQL console. In the instance list, click the ID or Manage in the Operation columnof the source instance with proxy enabled to enter the instance management page.
2. On the instance management page, select the Database Proxy > Overview, and click icon

after the target node ID in the Proxy Node column, then you can view the performance monitoring data of the node.

The displayed page after redirection is as follows.

©2013-2022 Tencent Cloud. All rights reserved.

Page 164 of 461

TencentDB for MySQL

Load Rebalancing：

Last updated 2024-07-22 15:18:09
After the database proxy is enabled, you can view Connections in the proxy node list or the performance monitoringdata of each proxy node to check whether the numbers of connections on the nodes are unbalanced. If there is a large
number of persistent connections, increasing the number of the database proxy nodes may also cause load imbalanceamong them, and if so, you can distribute the connections by clicking Rebalance. This document describes how tomanually rebalance the node in the console.

Prerequisites
You have enabled the database proxy. For more information, see Enabling Database Proxy.

Directions
1. Log in to the TencentDB for MySQL console. Select the region at the top of the page and click the target instance ID
to enter the instance management page.
2. On the instance management page, select Database Proxy > Overview, find the target access address inConnection Address, and click Rebalance in the Operation column.

3. In the pop-up window, click OK.
Note:
Rebalancing will cause the disconnection of the session to the address, during which the service will be unavailable
momentarily. We recommend that you restart the service during off-peak hours. Make sure that your business has areconnection mechanism.

©2013-2022 Tencent Cloud. All rights reserved.

Page 165 of 461

TencentDB for MySQLDisabling Database Proxy：

Last updated 2024-07-22 15:18:21
This document describes how to disable database proxy in the TencentDB for MySQL console.
Note:
Before disabling the database proxy, make sure that your client does not access the database through the proxyaddress, as the generated data will be deleted and cannot be recovered after the database proxy is disabled.

Prerequisites
You have enabled the database proxy. For more information, see Enabling Database Proxy.

Directions
1. Log in to the TencentDB for MySQL console. In the instance list, select the desired instance, click an instance ID or
Manage in the Operation column to enter the instance management page.
2, On the instance management page, select Database Proxy > Overview > Basic Info > Disable Database
Proxy.

2. In the pop-up dialog box, confirm that everything is correct and click OK.

©2013-2022 Tencent Cloud. All rights reserved.

Page 166 of 461

TencentDB for MySQLTransaction Split Feature：

Last updated 2024-07-22 15:19:24
The TencentDB for MySQL database proxy provides the transaction split feature. This feature separates read andwrite operations in one transaction to different instances for execution and forwards read requests to read-only
instances, thereby lowering the load of the source instance.

Background
By default, the TencentDB for MySQL database proxy forwards all requests in a transaction to the source instance toensure the transaction correctness. In some frameworks, however, all requests are encapsulated to transactions thatare not committed automatically, causing an excessive load of the source instance. In this case, you can use thetransaction split feature.
The transaction split feature is disabled by default. You can enable it by adjusting the configuration of the databaseproxy address.

Prerequisites
You have enabled the database proxy. For more information, see Enabling Database Proxy.

Directions
1. Log in to the TencentDB for MySQL console, select the region at the top of the page, and click the ID of the target
instance to enter the instance management page.
2. On the instance management page, select Database Proxy > Access Policy, find the target access policy, andclick Settings.
Note:
You can also find the target access address in Database Proxy > Overview > Connection Address. Then, click
Adjust Configurations in the Operation column.
3. In the pop-up window, toggle on Transaction Split and click OK.

©2013-2022 Tencent Cloud. All rights reserved.

Page 167 of 461

TencentDB for MySQL©2013-2022 Tencent Cloud. All rights reserved.

Page 168 of 461

TencentDB for MySQL

Momentary Disconnection Prevention Feature：

Last updated 2024-07-22 15:19:36
This document describes the momentary disconnection prevention feature of the TencentDB for MySQL databaseproxy.

Background
During the instance Ops, you may need to make some adjustments, such as configuration modification, planned HA
switch, and planned restart. Theses Ops may cause the problems, such as session interruption, momentary
disconnection and failed new connections. The TencentDB for MySQL database proxy provides the momentary
disconnection prevention feature that enables lossless application continuity to prevent disconnection and transaction
interruption.

How It Works
The momentary disconnection prevention feature implements MySQL’s session track mechanism. When the lossy
behavior is perceived, the database proxy will disconnect the client from the source node before the switch, andconnect to the source node after the switch. Then the session-related system variables, user variables, and character
set encoding information will be transferred to the new backend connection through the session track mechanism, so
as to realize the lossless switching on the application side.

©2013-2022 Tencent Cloud. All rights reserved.

Page 169 of 461

TencentDB for MySQL

Notes
If the statement uses the temp tables associated with each session, the connection cannot be recovered, and an error
will be reported.
To use the momentary disconnection prevention feature, you need to upgrade the database proxy kernel version tov1.3.1 or later.
The disconnection prevention feature will stop the transactions over 3 seconds.
When the connection is switched, if the database proxy is receiving the result message from the database, only part ofthe data will be transferred due to the source/replica switch, and the momentary disconnection prevention feature will
be disabled.

Performance Testing©2013-2022 Tencent Cloud. All rights reserved.

Page 170 of 461

TencentDB for MySQLThe performance test of the momentary disconnection prevention feature for Tencent DB for MySQL database proxyis described in the following.

Test environment
Region/AZ: Beijing - Beijing Zone 7
Client: S5.8XLARGE64 (32-core 64 GB Standard S5)
Client operating system: CentOS 8.2 64-bit
Network: Both the CVM and TencentDB for MySQL instances are in the same VPC subnet.
The information of the tested TencentDB for MySQL instance is as follows:
Storage type: Local SSD disk
Instance type: General
Parameter template: High-performance template

Test tool
SysBench, as the tool for the performance test, is a modular, cross-platform, and multi-threaded benchmark tool forevaluating OS parameters that are important for a system running a database under intensive load. The idea of thisbenchmark suite is to quickly get an impression about system performance without setting up complex databasebenchmarks or even without installing a database at all.

Test method
In different Ops scenarios, you can analyze the ratio of momentary disconnections before and after the operation totest whether a database proxy provides momentary disconnection prevention for the high-availability MySQL instance.

Test Results
In the following Ops scenarios, the high-availability MySQL instance maintains a 100% connection keep-alive rate by
the momentary disconnection prevention capability of the database proxy.
Ops scenario

Keep-alive rate

Performing source-replica switch

100%

Upgrading kernel minor version

100%

Adjusting the instance specifications

100%©2013-2022 Tencent Cloud. All rights reserved.

Page 171 of 461

TencentDB for MySQL

Automatic Read/Write Separation Feature
Automatic Read/Write Separation Overview：

Last updated 2024-07-22 15:20:14
This document describes the automatic read/write separation feature of the database proxy service in TencentDB for
MySQL and its strengths and routing rules.

Automatic Read/Write Separation
Currently, businesses of many users in the production environment have problems such as more reads and less writes
and unpredictable business loads. In application scenarios with a large number of read requests, a single instance
may not be able to withstand the pressure of read requests, which even may affect the businesses. To implement the
auto scaling of read capabilities and mitigate the pressure on the database, you can create one or multiple read-only
instances and use them to sustain high numbers of database reads. However, this solution requires that businesses
can be transformed to support read/write separation, and the code robustness determines the quality of businessread/write separation, which imposes high technical requirements and has low flexibility and scalability.
Therefore, after creating a read-only instance, you can purchase a database proxy, configure access address policy,
and configure the database proxy address in your application so as to automatically forward write requests to thesource instance and read requests to the read-only instance. In addition, this method provides natural solutions toother business challenges as detailed below:
Scenarios where the load is unpredictable or fluctuates irregularly with obvious peaks and troughs
In internet business scenarios, business load and access pressure are often unpredictable and unstable, and there
will be frequent great fluctuations. If the business uses a large number of non-persistent connections to access the
database, it is easy to generate many new connections. In other words, the number of connections between the
database and the application is likely to fluctuate as the business access pressure changes frequently, and this isoften difficult to predict.
Connection management for the dedicated database proxy allows you to efficiently reuse database connections toappropriately scale applications that handle unpredictable workloads. First, this feature allows multiple application
connections to share the same database connection to effectively use database resources. Second, it allows you toadjust the number of open database connections to maintain predictable database performance. Finally, it allows you
to delete unusable application requests to guarantee the overall application performance and availability.
Scenarios where the application is frequently connected to and disconnected from the database
Applications built based on technologies such as serverless, PHP, or Ruby on Rails may frequently open and close
database connections to process application requests.

©2013-2022 Tencent Cloud. All rights reserved.

Page 172 of 461

TencentDB for MySQLThe dedicated database proxy can help you maintain a database connection pool to prevent unnecessary pressure on
data computing and the memory used to establish new connections.
Scenarios where the database access connection is idle for a long time and is not released
SaaS applications and traditional ecommerce applications may make database connections idle to minimize theresponse time for user reconnection. You can use the dedicated database proxy to retain idle connections andestablish database connections as needed instead of excessively increasing the threshold or providing databaseservices with higher specifications to support most idle connections.
Scenarios where you want to improve the smoothness and stability of database PaaS service failover
With the dedicated database proxy, you can build applications that can tolerate active and passive database failuresin an imperceptible manner with no need to write complex failure processing code. The dedicated database proxy willautomatically route read traffic to new database instances while retaining the application connections.

Advantages
Read/write requests are automatically separated with a unified access address.
Native linkage support improves the performance and reduces the maintenance costs.
You can flexibly set weights and thresholds.
Failover is supported, so that even if the database proxy fails, requests can access the source database normally.
When a source instance is switched, or its configuration is changed, or a read-only instance is added/removed, thedatabase proxy can dynamically hot reload the configuration without causing network disconnections or restarts.

©2013-2022 Tencent Cloud. All rights reserved.

Page 173 of 461

TencentDB for MySQL

Read/Write Separation Routing Rules
Sending to the source instance
DDL statements such as CREATE , ALTER , DROP , and RENAME .
DML statements such as INSERT , UPDATE , and DELETE .
SELECT FOR UPDATE statement.
Statements related to temp tables.
Certain system function calls (such as last_insert_id() ) and all custom function calls.
Statements related to LOCK .
Statements after transaction is enabled (including set autocommit=0 ).
Stored procedures.
Multiple statements concatenated by ";".
KILL (SQL statement, not command).
All queries and changes of user variables.

Sending to the read-only instanceNon-transactional read ( SELECT ) statements.

Sending to all instances
show processlist statement.
All changes of system variables ( SET command).
USE command.

©2013-2022 Tencent Cloud. All rights reserved.

Page 174 of 461

TencentDB for MySQL

Configuring Database Proxy Read-Write
Attributes：

Last updated 2024-07-22 15:21:09
After creating a read-only instance, you can purchase the database proxy service and configure the connection
address policy. Then, you can configure the database proxy address in your application so as to automatically forward
write requests to the source instance and read requests to the read-only instance. This document describes how to
enable read/write separation in the console.

Prerequisites
You have enabled the database proxy. For more information, see Enabling Database Proxy.

Directions
1. Log in to the TencentDB for MySQL console, select the region at the top of the page, and click the ID of the target
instance to enter the instance management page.
2. On the instance management page, select Database Proxy > Overview, find the target access address inConnection Address, and click Adjust Configurations in the Operation column.

©2013-2022 Tencent Cloud. All rights reserved.

Page 175 of 461

TencentDB for MySQL

3. In the pop-up window, set Read-Write Attribute, assign the read weight, and click OK.
Note:
The weight here pertains to the allocation strategy for read requests (non-transactional).

©2013-2022 Tencent Cloud. All rights reserved.

Page 176 of 461

TencentDB for MySQL©2013-2022 Tencent Cloud. All rights reserved.

Page 177 of 461

TencentDB for MySQL

Connection Pool Feature
Connection Pool Overview：

Last updated 2024-06-18 16:33:11
TencentDB for MySQL database proxy supports the connection pool feature, currently offering session-level andtransaction-level connection pools, which can effectively solve the issue of high instance loads due to frequentestablishments of new connections by short connection services. This document introduces the features of sessionlevel connection pool.

Prerequisites
You have enabled the database proxy.
The database kernel minor version is MySQL 5.7 20211030 or later.
The database kernel minor version is MySQL 8.0 20230630 or later.

：

Note

The database proxy connection pool capability has been identified to cause deadlock issues during the 'change user'
operation in earlier minor versions of the MySQL kernel. This issue has been rectified in the MySQL 8.0 20230630
minor kernel version. If the minor kernel version of your primary instance has not been updated to MySQL 8.0
20230630, there is a certain level of risk involved. It is recommended to disable the database proxy connection poolcapability. If you want to continue utilizing the database proxy connection pool capability, it is advised to upgrade theminor kernel version of your primary instance to MySQL 8.0 20230630 or later. For instructions on upgrading, refer to
upgrading kernel minor version.

Background
Session-level connection pool©2013-2022 Tencent Cloud. All rights reserved.

Page 178 of 461

TencentDB for MySQLThe session-level connection pool is applicable to non-persistent connection scenarios.
The session-level connection pool is used to reduce the instance load caused by frequent establishments of new nonpersistent connections. If a client connection is closed, the system will determine whether the current connection isidle, and if so, the system will put it into the proxy connection pool and retain it for a short period of time.
When the client initiates a new connection, if the connection pool has an available connection, the connection can beused directly to reduce the database connection overheads; otherwise, a new connection will be established as usual.
Note:
The session-level connection pool does not reduce the number of concurrent connections to the database, but it can
reduce the overheads of the main thread of TencentDB for MySQL by lowering the speed for connecting theapplication to the database, so as to better process business requests. However, idle connections in the connection
pool will occupy your connection quantity temporarily.
The session-level connection pool cannot be used to solve the problem of connection heap caused by a large numberof slow SQL queries, which must first be solved by yourself.

Notes
Currently, the connection pool feature does not support setting different permissions for different IPs under the sameaccount, as that may cause a permission error during connection reuse. For example, if mt@test123 has
database_a permissions, while mt@test456 does not, a permission error may occur when you enable theconnection pool.
The connection pool feature is for the database proxy instead of the client. You don't need to use the connection poolof the database proxy if your client already supports it.

©2013-2022 Tencent Cloud. All rights reserved.

Page 179 of 461

TencentDB for MySQL

Enabling and Disabling the Connection Pool
Feature：Last updated 2024-05-09 17:43:00
This document describes how to enable or disable the connection pool feature.

Prerequisites
You have enabled the database proxy.
The database kernel minor version is MySQL 5.7 20211030 or later.
The database kernel minor version is MySQL 8.0 20230630 or later.

：

Note

The database proxy connection pool capability has been identified to cause deadlock issues during the 'change user'
operation in earlier minor versions of the MySQL kernel. This issue has been rectified in the MySQL 8.0 20230630
minor kernel version. If the minor kernel version of your primary instance has not been updated to MySQL 8.0
20230630, there is a certain level of risk involved. It is recommended to disable the database proxy connection poolcapability. If you want to continue utilizing the database proxy connection pool capability, it is advised to upgrade theminor kernel version of your primary instance to MySQL 8.0 20230630 or higher. For instructions on upgrading,please refer to upgrading kernel minor version.

Enabling the connection pool feature
1. Log in to the TencentDB for MySQL console, select the region at the top of the page, and click the ID of the target
instance to enter the instance management page.
2. On the instance management page, select Database Proxy > Access Policy, find the target access policy, andclick Settings.
Note:
You can also find the target access address in Database Proxy > Overview > Connection Address. Then, click
Adjust Configurations in the Operation column.
3. In the pop-up window, toggle on Connection Pool Status. Once it is enabled, select Session-Level Connection
Pool or Transaction-Level Connection Pool (database proxy kernel version 1.4.1 or later needed), and click OK.

©2013-2022 Tencent Cloud. All rights reserved.

Page 180 of 461

TencentDB for MySQLDisabling the connection pool feature
1. Log in to the TencentDB for MySQL console, select the region at the top of the page, and click the ID of the target
instance to enter the instance management page.
2. On the instance management page, select Database Proxy > Access Policy, find the target access policy, andclick Settings.
Note:©2013-2022 Tencent Cloud. All rights reserved.

Page 181 of 461

TencentDB for MySQLYou can also find the target access address in Database Proxy > Overview > Connection Address. Then, click
Adjust Configurations in the Operation column.
3. In the pop-up window, toggle off Connection Pool Status and click OK.

©2013-2022 Tencent Cloud. All rights reserved.

Page 182 of 461

TencentDB for MySQLOther Features
Hint Syntax Usage：

Last updated 2024-07-22 15:21:57
This document describes how to use the hint syntax on the database proxy.
The hint syntax can be used to forcibly execute SQL requests on the specified instance. A hint has the highest routing
priority. For example, it is not subject to consistency and transaction constraints.You need to reasonably evaluate
whether it is required in your business scenario before using it.
Note:
When using the MySQL command line tool to connect and use the HINT statement, you need to add the -coption in the command; otherwise, the hint will be filtered by the tool.
The database proxy kernel version greater than or equal to version 1.1.3 supports PREPARE statement when thehint syntax is used through the database proxy.
Currently, three types of hints are supported:
Assign to the source instance for execution:©2013-2022 Tencent Cloud. All rights reserved.

Page 183 of 461

TencentDB for MySQL/* to master */or/*FORCE_MASTER*/
Assign to a read-only instance for execution:©2013-2022 Tencent Cloud. All rights reserved.

Page 184 of 461

TencentDB for MySQL/* to slave */or/*FORCE_SLAVE*/
Specify an instance for execution:©2013-2022 Tencent Cloud. All rights reserved.

Page 185 of 461

TencentDB for MySQL/* to server server_name*/server_name can be a short ID, such as /* to server test_ro_1 */ .

©2013-2022 Tencent Cloud. All rights reserved.

Page 186 of 461

TencentDB for MySQL

Account Management
Creating Account：

Last updated 2024-07-22 15:27:14

Overview
In addition to the default root account created by the system, you can also create other database accounts in theTencentDB for MySQL console as needed.

Directions
1. Log in to the TencentDB for MySQL console. In the instance list, click an instance ID or Manage in the Operation
column to enter the instance management page.
2. On the instance management page, select Database Management> Account Management and click Create
Account.

3. In the pop-up window, enter the account name, host, and password, confirm the password, and click OK.
Account Name:In MySQL 5.5 and 5.6, the database account name can contain 1–16 letters, digits, or underscores. It must begin witha letter and end with a letter or digit.
In MySQL 5.7 and 8.0, the database account name can contain 1–32 letters, digits, or underscores. It must begin witha letter and end with a letter or digit.

©2013-2022 Tencent Cloud. All rights reserved.

Page 187 of 461

TencentDB for MySQL

Host: Specify a host address to access the database. It can be an IP and contain % (indicating no limit on the IP
range). Multiple hosts should be separated by line break, space, semicolon, comma, or vertical bar.
Example 1: Enter % to indicate no limit on the IP range, that is, clients at all IP addresses are allowed to use thisaccount to connect to the database.
Example 2: Enter 10.5.10.% to indicate that clients with an IP range within 10.5.10.% are allowed to use thisaccount to connect to the database.
Password: The password must contain 8–64 characters in at least two of the following character types: letters, digits,
and special symbols \\_+-&amp;=!@#$%^\\*() . You can also set the password complexity to improve thedatabase security as instructed in Setting Password Complexity.
Maximum Connections: The number of connections for this account, which must be no more than 10,240. If you
don't enter a value, no limit will be imposed (subject to the maximum number of connections).
4. After successful creation, the database account can be managed in the database account list of the current
instance.

Related APIs
API Name

Description

CreateAccounts

Creates a TencentDB account©2013-2022 Tencent Cloud. All rights reserved.

Page 188 of 461

TencentDB for MySQL

Setting Password Complexity：

Last updated 2024-07-22 15:27:34
TencentDB for MySQL allows you to set the password complexity to improve the strength of database accesspasswords and optimize the database security.

Prerequisites
The database version is:
MySQL 5.6, with minor version 20201231 or later.
MySQL 5.7, with minor version 20201231 or later.
MySQL 8.0, with minor version 20201230 or later.
The instance must be on a two-node/three-node architecture.

Use Limits
For any password set during account creation or reset in the TencentDB for MySQL console, it must at least meet thefollowing initial account password requirements:
It can contain 8 to 64 characters
It must contain at least three of the following character types: uppercase letters, lowercase letters, digits, and special
symbols.
Special characters are _+-&=!@#$%^*() .

Enabling Password Complexity
Note:
After the password complexity feature is enabled, any password set during account creation or reset must follow the
password complexity policy.

Enabling when creating an instance on the purchase page
1. Log in to the TencentDB for MySQL purchase page.
2. Configure parameters as needed. Select Enable after the Password Complexity parameter.

©2013-2022 Tencent Cloud. All rights reserved.

Page 189 of 461

TencentDB for MySQL

3. Set the following parameters.
Parameter
Min Number of Uppercase
or Lowercase Letters

Description
You can select a number between 1 (default value) and 16.

Min Number of Digitals

You can select a number between 1 (default value) and 16.

Min Number of Symbols

You can select a number between 1 (default value) and 16.

Min Number of Password
Characters

You can select a number between 8 (default value) and 64. The minimum value
must be greater than the sum of the above three parameters.

Enabling for existing instances in the console
1. Log in to the TencentDB for MySQL console. In the instance list, click an instance ID or Manage in the Operation
column to enter the instance management page.
2. On the instance management page, select Database Management> Account Management and click
Password Complexity (disabled by default).

3. Select Enable in the Password Complexity pop-up window, set the following parameters, and click OK.

©2013-2022 Tencent Cloud. All rights reserved.

Page 190 of 461

TencentDB for MySQLParameter
Min Number of Uppercase or Lowercase
Letters

Description
You can select a number between 1 (default value) and 16.

Min Number of Digitals

You can select a number between 1 (default value) and 16.

Min Number of Symbols

You can select a number between 1 (default value) and 16.
You can select a number between 8 (default value) and 64. The

Min Number of Password Characters

minimum value must be greater than the sum of the above threeparameters.

Disabling Password Complexity
1. Log in to the TencentDB for MySQL console. In the instance list, click an instance ID or Manage in the Operation
column to enter the instance management page.
2. On the instance management page, select Database Management> Account Management and click
Password Complexity.

©2013-2022 Tencent Cloud. All rights reserved.

Page 191 of 461

TencentDB for MySQL

3. Select Disable in the Password Complexity pop-up window and click OK.

Relevant Documentation
Creating AccountResetting Password©2013-2022 Tencent Cloud. All rights reserved.

Page 192 of 461

TencentDB for MySQL

Resetting Password：

Last updated 2024-07-22 15:27:49

Overview
If you forgot your database account password or need to change it while using TencentDB for MySQL, you can reset itin the console.
Note:
For TencentDB for MySQL, the password resetting feature has been connected to CAM; therefore, we recommendthat you exercise tighter control over the permission to this API (password resetting) or sensitive resources (i.e.,
TencentDB for MySQL instances) by granting such permission only to appropriate personnel.
For data security, we recommend that you regularly reset the password at least once every three months.

Directions
1. Log in to the TencentDB for MySQL console. In the instance list, click an instance ID or Manage in the Operation
column to access the instance management page.
2. On the instance management page, select Database Management > Account Management, find the accountfor which to reset the password, and click Reset Password or select More > Reset Password.

3. In the pop-up window, enter a new password, confirm the password, and click OK.
Note:
The password should be a combination of 8–64 characters containing at least two of the three types: letters, digits,
and symbols (_+-&=!@#$%^*()).

Related APIs

©2013-2022 Tencent Cloud. All rights reserved.

Page 193 of 461

TencentDB for MySQLAPI Name

Description

ModifyAccountPassword

Modifies the password of a TencentDB account©2013-2022 Tencent Cloud. All rights reserved.

Page 194 of 461

TencentDB for MySQL

Modifying Account Permissions：

Last updated 2023-12-05 17:32:58

Operational Scenario
You have the capability to manage existing database accounts through the MySQL Cloud Database Console, granting
them either global privileges or object-level privileges. Concurrently, you also possess the ability to revoke theseauthorizations.

Account Authorization Description
Authorization

Description

ALTER

The authority to alter the structure of tables within the database, encompassing themodification of table fields, the addition and deletion of table fields, as well as thecreation and removal of table indices.

ALTER ROUTINECREATE

Modify the permissions of routines such as stored procedures and functions.
The authority to create new objects such as databases, tables, views, stored
procedures, and functions.

CREATE ROUTINE

The authority to create routine objects such as stored procedures and functions.

CREATE TEMPORARY
TABLES

The authorization to create temporary tables.

CREATE USERThis authority allows for the creation of new users and the allocation ofcorresponding permissions to them.

CREATE VIEW

The authority to create view objects.

DELETEThe authority to delete data from a specified table.

DROP

The authority to delete objects such as databases, tables, views, stored
procedures, and functions.

EVENT

The authority to create, modify, and eradicate events.

EXECUTE

This authority permits users to execute pre-existing objects such as stored
procedures and functions.

©2013-2022 Tencent Cloud. All rights reserved.

Page 195 of 461

TencentDB for MySQLINDEXThe authority to create and eradicate indices.

INSERT

The authority to insert or write new data into the table.

LOCK TABLES
PROCESS
REFERENCESRELOADREPLICATION CLIENT

Securing the requisite permissions for executing read and write operations on thedesignated data table.
The authority to view the information of all currently active threads and processes.
The authority to create or remove foreign key constraints within the current
database.
The authority to reload certain system configuration files, as well as to restart or
shut down the database.
Authority to observe and administer the status and parameters of the replication
process.

REPLICATION SLAVEThe authority to replicate data from the Master server.

SELECT

The authority to query data from the designated table.

SHOW DATABASES

Display the permissions of all databases in the current database server.

SHOW VIEW

Displaying the permissions of the view.

TRIGGER

Authority to create and administer triggers.

UPDATE

Permission to update data in a specified table.

Directions
1. Log in to the TencentDB for MySQL console. In the instance list, click the instance ID or Manage in the Operation
column to access the instance management page.
2. Select the Database Management > Account Management tab, find the account for which to modify thepermissions, and click Modify Permissions.

©2013-2022 Tencent Cloud. All rights reserved.

Page 196 of 461

TencentDB for MySQL

3. In the pop-up dialog box, select or deselect permissions and click OK to complete the modification.
Global Privileges: Grant global permissions to all databases in the instance.
Object-Level Privileges: Grant permissions to certain databases in the instance.

©2013-2022 Tencent Cloud. All rights reserved.

Page 197 of 461

TencentDB for MySQL

Related APIs
API Name

Description

ModifyAccountPrivileges

Modifies the permissions of a TencentDB instance account©2013-2022 Tencent Cloud. All rights reserved.

Page 198 of 461

TencentDB for MySQL

Modifying Host Addresses with Access
Permissions：

Last updated 2024-07-22 15:28:14

Operation Scenario
By modifying the host address authorized by the database account in the TencentDB for MySQL console, you cancontrol the access to the database to improve the access security.

Directions
1. Log in to the TencentDB for MySQL console.
2. In the instance list, select the instance to be modified and click the instance name or Manage in the Operation
column to enter the instance management page.
3. Select Database Management > Account Management, find the account for which to modify the host, andselect More > Modify Host.

©2013-2022 Tencent Cloud. All rights reserved.

Page 199 of 461

TencentDB for MySQL

4. In the pop-up dialog box for modifying host, enter the new host address and click OK.
Note:
The host address may come in the format of an IP address. To allow all the clients to access the database using thedatabase account, enter '%'.

©2013-2022 Tencent Cloud. All rights reserved.

Page 200 of 461

TencentDB for MySQL

Deleting Account：

Last updated 2024-07-22 15:28:27

Operation Scenarios
In order to disable an existing database account, it must be deleted in the TencentDB for MySQL console.
Note:
A database account cannot be recovered once deleted.
In order to avoid accidental deletion from interrupting normal use by your business, you need to make sure that the
database account to be deleted is no longer used by any applications.

Directions
1. Log in to the TencentDB for MySQL Console. In the instance list, click an instance ID or Manage in the "Operation"column to enter the instance management page.
2. Select the Database Management > Manage Account tab, find the account to be deleted, and select More >Delete Account.

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

©2013-2022 Tencent Cloud. All rights reserved.

Page 201 of 461

TencentDB for MySQL

Related APIs
API Name

Description

DeleteAccounts

Deletes a TencentDB account©2013-2022 Tencent Cloud. All rights reserved.

Page 202 of 461

TencentDB for MySQL

Database Management Center (DMC)DMC Overview：

Last updated 2024-07-22 15:31:37

Overview
Database Management Center (DMC) is a one-stop Tencent Cloud database management tool. Services supported
include database/table-level operations, real-time monitoring, instance session management, SQL window, and data
management.
DMC is currently supported for TencentDB for MySQL, TencentDB for MariaDB, TDSQL-C for MySQL, TencentDB
for Redis, and TDSQL for MySQL.

Features
Data management
It supports database operations such as creating and deleting databases/tables, modifying table structures, andmaintaining table data.
Database instance session management
It displays multidimensional instance session information to help you easily view and perform relevant operations.
Database monitoring
It supports multidimensional monitoring of database status, InnoDB row operations, database connections, and traffic.
SQL window
It provides a SQL compiler and can save frequently used SQL templates and custom SQL statements. It can also
display and export SQL statement execution results.

Benefits
Ease of use
DMC aims to provide easy-to-use database management services. You can use the convenient operation interface toperform database operations such as creating databases/tables.
Visualization
You do not need to separately install drivers or applications to use DMC. Instead, you just need to log in to the DMC
console to manage, monitor, and manipulate databases in multiple dimensions through the visualization management
page.

©2013-2022 Tencent Cloud. All rights reserved.

Page 203 of 461

TencentDB for MySQL

Real-Time database status monitoring
DMC can collect database instance data in real time such as CPU utilization, number of connections, and storage
capacity usage, so as to intuitively display database instance running conditions.
Real-Time database performance monitoring
DMC supports database performance monitoring at the second level, covering multiple monitoring items related to
MySQL status, InnoDB row operations, threads, and network to help you monitor fluctuations in each performance
item in real time. In addition, it supports the categorized calculation of sessions and allows you to kill instancesessions, helping you quickly locate causes of exceptions and implement performance optimization.

©2013-2022 Tencent Cloud. All rights reserved.

Page 204 of 461

TencentDB for MySQLDMC Management：

Last updated 2024-07-22 15:36:14
This document describes the features of DMC, such as database/table creation, database management, instancemonitoring, instance session management, and visualized table data editing.

Database/Table Creation
1. Log in to DMC and select Create > Create Database > Create Database or Create > Create Table on thenavigation bar at the top.

2. In the pop-up dialog box, configure the new database or table.
Note:
For more information on the character set and collation, see MySQL official documentation.
Database creation dialog box:

©2013-2022 Tencent Cloud. All rights reserved.

Page 205 of 461

TencentDB for MySQL

Table creation dialog box:

©2013-2022 Tencent Cloud. All rights reserved.

Page 206 of 461

TencentDB for MySQL

Database Management
Log in to DMC, select Database Management on the navigation bar at the top, and create, edit, or delete databaseson the displayed page.

©2013-2022 Tencent Cloud. All rights reserved.

Page 207 of 461

TencentDB for MySQL

Instance Session Management
Log in to DMC, select Instance Session on the navigation bar at the top, and enter the instance session
management page. You can view the details of all database sessions in the instance from four dimensions: session
overview, users, access sources, and databases.
DMC allows you to kill sessions, facilitating your session management.

©2013-2022 Tencent Cloud. All rights reserved.

Page 208 of 461

TencentDB for MySQLSQL Window
Log in to DMC, select SQL Window on the navigation bar at the top, or click SQL Operation on the Operation
menu on the left sidebar to access the SQL window, which supports the following features:
Run SQL commands and view results
Optimize SQL statement formats
View SQL command execution plans
Save commonly used SQL statements
Use SQL templates
Export SQL statement execution results©2013-2022 Tencent Cloud. All rights reserved.

Page 209 of 461

TencentDB for MySQL

Data Management
Log in to DMC, select Data Management > Data Importing or Data Exporting on the navigation bar at the top, andyou can import data into or export data from a database.

©2013-2022 Tencent Cloud. All rights reserved.

Page 210 of 461

TencentDB for MySQL

Visualized Table Data Editing
DMC for MySQL supports inserting, deleting, and updating data. You can click a table in the left Table list to insert,
delete, and update its data in batches in the right pane, and then click OK in the Quick Operation pane to preview
the SQL statements and implement the modification.

©2013-2022 Tencent Cloud. All rights reserved.

Page 211 of 461

TencentDB for MySQLParameter Configuration
Setting Instance Parameters：

Last updated 2024-07-22 15:41:12
You can view and modify certain parameters and query parameter modification logs in TencentDB for MySQL
console.
Note:
You can modify the parameters of both source and read-only instances in the console in the same way as detailed
below.

Use Limits
To ensure instance stability, only some parameters can be modified in the console. These parameters are displayedon the Parameter Settings page.
If the modified parameter requires instance restart to take effect, the system will ask you if you want to restart. We
recommend that you do so during off-peak hours and ensure that your application has a reconnection mechanism.
If you want to return to the default formula, clear the entered parameters and apply.

Modifying Parameters in Parameter List
Batch modifying parameters
1. Log in to the TencentDB for MySQL console. In the instance list, click an instance ID or Manage in the Operation
column to access the instance management page.
2. Select Database Management > Parameter Settings and click Batch Modify Parameters.
UI for the source instance:©2013-2022 Tencent Cloud. All rights reserved.

Page 212 of 461

TencentDB for MySQLUI for the read-only instance:

3. Locate the desired parameters, and modify their values in the Current Value column. After confirming thateverything is correct, click Confirm Modification.

©2013-2022 Tencent Cloud. All rights reserved.

Page 213 of 461

TencentDB for MySQL

4. In the pop-up window, select an option in the Execution Mode and click OK.
Note:
If you select Immediate execution, the parameter modification task will be executed and take effect immediately.
If you select During maintenance time, the parameter modification task will be executed and take effect during thistime. For more information, see Setting Instance Maintenance Window.

Modifying one parameter
1. Log in to the TencentDB for MySQL console, click an instance ID in the instance list, and enter the instancemanagement page.
2. On the Database Management > Parameter Settings tab, locate the desired parameter in the parameter list andclick

in the Current Value column.

©2013-2022 Tencent Cloud. All rights reserved.

Page 214 of 461

TencentDB for MySQL

3. Modify the value within the restrictions stated in the Acceptable Values column and click

to save the modification. You can click

to cancel the operation.

4. In the pop-up window, select an option in the Execution Mode and click OK.
Note:
If you select Immediate execution, the parameter modification task will be executed and take effect immediately.
If you select During maintenance time, the parameter modification task will be executed and take effect during thistime. For more information, see Setting Instance Maintenance Window.

Modifying Parameters by Importing Parameter Template
Option 1. Importing a parameter template on the Parameter Settings page©2013-2022 Tencent Cloud. All rights reserved.

Page 215 of 461

TencentDB for MySQL

1. Log in to the TencentDB for MySQL console, click an instance ID in the instance list, and enter the instancemanagement page.
2. Select Database Management > Parameter Settings and click Custom Template. If you haven't configured acommonly used custom template yet, you can select Custom Template on the left sidebar in the TencentDB for
MySQL console, click Create Template to configure a parameter template, and then import it from the custom
template as described in this step.

3. In the pop-up window, select a parameter template and click Import and Overwrite Original Parameters.

4. After confirming that everything is correct, click Confirm Modification.

©2013-2022 Tencent Cloud. All rights reserved.

Page 216 of 461

TencentDB for MySQL

5. In the pop-up window, select an option in the Execution Mode and click OK.
Note:
If you select Immediate execution, the parameter modification task will be executed and take effect immediately.
If you select During maintenance time, the parameter modification task will be executed and take effect during thistime. For more information, see Setting Instance Maintenance Window.

Option 2. Modifying parameters by importing a parameter configuration file
1. Log in to the TencentDB for MySQL console, click an instance ID in the instance list, and enter the instancemanagement page.
2. Select Database Management > Parameter Settings and click Import Parameters.

3. Click Select File to locate the desired parameter file and click Import and Overwrite Original Parameters.

©2013-2022 Tencent Cloud. All rights reserved.

Page 217 of 461

TencentDB for MySQL

4. After confirming that everything is correct, click Confirm Modification.
5. In the pop-up window, select the execution mode and click OK.
Note:
If you select Immediate execution, the parameter modification task will be executed and take effect immediately.
If you select During maintenance time, the parameter modification task will be executed and take effect during thistime. For more information, see Setting Instance Maintenance Window.

Option 3. Importing a parameter template on the "Parameter Template" pageFor more information, see Managing Parameter Template > Applying a Parameter Template to a Database.

Restoring to Default Template
1. Log in to the TencentDB for MySQL console, click an instance ID in the instance list, and enter the instancemanagement page.
2. Select Database Management > Parameter Settings, click Default Template, select High-Stability
Template or High-Performance Template, and click Import and Overwrite Original Parameters.

3. Click Confirm Modification to redirect to the parameter modification confirmation window.

©2013-2022 Tencent Cloud. All rights reserved.

Page 218 of 461

TencentDB for MySQL

4. In the pop-up window, select an option in Execution Mode, read and indicate your consent to the Restart Rules,
and click OK.
Note:
If you select Immediate execution, the parameter modification task will be executed and take effect immediately.
If you select During maintenance time, the parameter modification task will be executed and take effect during thistime. For more information, see Setting Instance Maintenance Window.

Parameter Formula
You can use a formula to set the instance parameters. To do so, set the parameters related to the instancespecification as a formula, and when the instance specification is changed, the parameter values in the formula will be
dynamically changed accordingly and still take effect after the specification change. In this way, the instance is always
in the optimal state for running business smoothly.
Taking the {DBinitMemory\\*786432} value of the parameter innodb_buffer_pool_size as an
example, when the DBinitMemory in the instance specification is changed, the parameter configuration here

©2013-2022 Tencent Cloud. All rights reserved.

Page 219 of 461

TencentDB for MySQL

doesn't need to be modified, and the value of innodb_buffer_pool_size will be changed automatically.

Expression syntax is supported as follows:
SupportedType

Description

SampleDBinitMemory: Instance memory in MB (integer type). For example, if
Variablethe memory size of the instance is 4000 MB, the value of DBinitMemoryis 4000. DBInitCpu: The number of CPU cores of the instance (integertype). For example, if the instance specification is 8 cores, the value of
DBInitCpu is 8.

{DBinitMemory *786432} = memory
size (DBinitMemory) *percentage (75% bydefault) * 1024 * 1024
(unit conversion)

Formula syntax: It should be enclosed in braces ( {} ). Division
operator (/): It divides the dividend by the divisor and returns an integer
quotient. If the calculation result is a decimal number, only the integer
part will be retained. Decimal numbers are not supported; for example,
Operator{MIN(DBInitMemory/4+500,1000000)} instead of{MIN(DBInitMemory0.25+500,1000000)} is supported.

-

Multiplication operator (*): It multiplies two numbers and returns an
integer product. If the calculation result is a decimal number, only the
integer part will be retained. Decimal number calculation is notsupported.
MAX(): It returns the greatest value in an integer or parameter formula
Functionlist. MIN(): It returns the smallest value in an integer or parameter
formula list.

{MAX(DBInitCpu/2,4)}

Parameters that support parameter formulas
Note:
TencentDB for MySQL continuously optimizes parameter settings. The following lists only certain parameters that
support parameter formula. You can learn more about parameter formulas in the parameter template in the console.
Parameter

Description

Default Formula

thread_pool_size

The number of thread groups in
the thread pool. The default value{MIN(DBInitCpu,64)}

means that the number of thread©2013-2022 Tencent Cloud. All rights reserved.

Page 220 of 461

TencentDB for MySQL

groups is the same as the numberof CPU cores.
table_open_cache_instances

The number of partitions where
MySQL caches table handles.

{MIN(DBInitMemory/1000,16)}The size of the table descriptor,
table_open_cachetable_definition_cache
max_connections

which can reduce the file
open/close times.
The number of opened table cacheinstances.
Max connections.

{MAX(DBInitMemory*512/1000,2048)}{MAX(DBInitMemory*512/1000,2048)}{MIN(DBInitMemory/4+500,1000000)}

The minimum size of the buffer
join_buffer_size

used for normal index scans, range
index scans, and table joins that

{MIN(DBInitMemory*128,262144)}

perform full-table scans.
innodb_write_io_threads

innodb_read_io_threads

innodb_buffer_pool_instances

innodb_buffer_pool_size

The number of I/O threads in
InnoDB used for write operations.
The number of I/O threads in
InnoDB used for read operations.
The number of partitions in the
InnoDB buffer pool.
The size of the buffer pool in bytes,
i.e., the memory zone where
InnoDB caches tables and index
data.

{MAX(DBInitCpu/2,4)}{MAX(DBInitCpu/2,4)}{MIN(DBInitMemory/2000,16)}{DBInitMemory*786432}

Exporting Parameter Configuration as File
1. Log in to the TencentDB for MySQL console, click an instance ID in the instance list, and enter the instancemanagement page.
2. Select Database Management > Parameter Settings and click Export Parameters to export the parameter
configuration file.

©2013-2022 Tencent Cloud. All rights reserved.

Page 221 of 461

TencentDB for MySQL

Exporting Parameter Configuration as Template
1. Log in to the TencentDB for MySQL console, click an instance ID in the instance list, and enter the instancemanagement page.
2. Select Database Management > Parameter Settings and click Save as Template to save the existing
parameter configuration as a parameter template.

Modifying Parameters During Custom Time Window
Before you confirm the parameter modification, the Modify Parameters dialog box will pop up for you to select acustom time window for the modification to take effect.
Note:
If you select During maintenance time, the parameter modification task will be executed and take effect during thistime. For more information, see Setting Instance Maintenance Window.

©2013-2022 Tencent Cloud. All rights reserved.

Page 222 of 461

TencentDB for MySQL

Canceling Parameter Modification Task
If a parameter modification task (to be executed during maintenance window) has been submitted but you want tocancel it, you can select Task List on the left sidebar in the console, locate the task, and click Cancel in the
Operation column. You can cancel a task only before it is executed. The task status should be Waiting forexecution.

Viewing Parameter Modification Log
1. Log in to the TencentDB for MySQL console, click an instance ID in the instance list, and enter the instancemanagement page.
2. On the Database Management > Parameter Settings tab, click Recent Modifications on the right.

©2013-2022 Tencent Cloud. All rights reserved.

Page 223 of 461

TencentDB for MySQL

3. You can view the recent parameter modification records here.

Subsequent Operations
You can use templates to manage database parameters in batches. For more information, see Managing Parameter
Template.
For suggestions on the configuration of key parameters, see Suggestions on Parameter Settings.

©2013-2022 Tencent Cloud. All rights reserved.

Page 224 of 461

TencentDB for MySQLManaging Parameter Template：

Last updated 2024-07-22 15:41:39
Besides the system parameter templates provided by TencentDB for MySQL, you can create custom parameter
templates in order to configure parameters in batches.
You can use the parameter template to configure and manage the parameters of a database engine. A template is likea container of the values of database engine parameters, which can be applied to one or more TencentDB instances.
You can log in to the TencentDB for MySQL console and click Parameter Templates on the left sidebar to create,view, and manage parameter templates which support the following features:Support default parameter templates.
Create templates by modifying the default parameters to generate custom parameter optimization schemes.
Import the MySQL configuration file my.conf to generate templates.
Save parameter configurations as templates.
Import parameters from templates to apply to one or more instances.
Note:
If the parameters in the template are updated, the instance parameters are not updated unless they are manually reapplied to the instances.
You can apply the parameter changes to single or multiple instances by importing a template.

Creating a Parameter Template
You can create a parameter template, modify the parameter values, and apply the template to instances.
1. Log in to the TencentDB for MySQL console, select Parameter Templates on the left sidebar, and click Create
Template.

2. In the pop-up dialog box, specify the following configurations, and click Create and Set Parameters.
Template Name: enter a unique template name.
Database Version: select a database version.

©2013-2022 Tencent Cloud. All rights reserved.

Page 225 of 461

TencentDB for MySQL

Template Description: enter a brief description of the parameter template.

3. After the creation is completed, you can modify, import, and export parameters on the template details page.

Applying a Parameter Template to Instances
1. Log in to the TencentDB for MySQL console and select Parameter Templates on the left sidebar.
2. In the parameter template list, locate the desired template and click Apply to Instance in the Operation column.

3. On the displayed page, specify the execution mode and instances, make sure that all parameter values are correct,
and click Submit.
Execution Mode: Immediate execution is selected by default. If you select During maintenance window, theparameter modification task will be executed and take effect during the instance maintenance period.
MySQL Instance: select one or more instances that need to apply the parameter template in the specified region.
Parameter Comparison: view the changed parameter values of the selected instance.
Note:
Before applying a parameter template to multiple instances, please make sure the parameters can be applied to thoseinstances.

©2013-2022 Tencent Cloud. All rights reserved.

Page 226 of 461

TencentDB for MySQL

4. (Optional) If a parameter modification or batch modification task has been submitted but you want to cancel it, you
can select Task List on the left sidebar in the console, locate the task, and click Cancel in the Operation column.
You can cancel a task only before it is executed. The task state should be "Waiting for execution".

Copying a Parameter Template
To include most of the custom parameters and values of an existing parameter template in a new template, you cancopy the existing template.

Method 1. Copying an existing parameter template
1. Log in to the TencentDB for MySQL console, select Parameter Templates on the left sidebar, click the parameter
template name or View Details in the Operation column in the template list, and enter the parameter template details
page.
2. Select More > Save as Template at the top.
3. In the pop-up dialog box, specify the following configurations:Template Name: enter a unique template name.

©2013-2022 Tencent Cloud. All rights reserved.

Page 227 of 461

TencentDB for MySQL

Template Description: enter a brief description of the parameter template.
4. After confirming that everything is correct, click Save.

Method 2. Saving parameters of an instance as a parameter template
1. Log in to the TencentDB for MySQL console, select Instance List on the left sidebar, and click an instanceID/name in the instance list to access the instance management page.
2. Select Database Management > Parameter Settings and click Save as Template.
3. In the pop-up dialog box, specify the following configurations:Template Name: enter a unique template name.
Template Description: enter a brief description of the parameter template.
4. After confirming that everything is correct, click Create and Save.

Modifying Parameter Values in a Parameter Template
1. Log in to the TencentDB for MySQL console, select Parameter Templates on the left sidebar, click the parameter
template name or View Details in the Operation column in the template list, and enter the parameter template details
page.
2. Click Batch Modify Parameters or clickin the Current Value column to modify the parameter value.
Note:
If you click Import Parameters, you need to upload a local parameter configuration file. To avoid importing failures,the configuration file should be in the same format as the configuration file of the MySQL database server, or you can
use the file template of the exported parameters.

©2013-2022 Tencent Cloud. All rights reserved.

Page 228 of 461

TencentDB for MySQL

Importing a Parameter Template
1. Log in to the TencentDB for MySQL console, select Parameter Templates on the left sidebar, click the parameter
template name or View Details in the Operation column in the template list, and enter the parameter template details
page.
2. Click Import Parameters.
Note:
If you click Import Parameters, you need to upload a local parameter configuration file. To avoid importing failures,the configuration file should be in the same format as the configuration file of the MySQL database server, or you can
use the file template of the exported parameters.
3. In the pop-up dialog box, select a file to upload and click Import and Overwrite Original Parameters.

Exporting a Parameter Template
Method 1
1. Log in to the TencentDB for MySQL console and select Parameter Templates on the left sidebar.
2. In the parameter template list, locate the desired template and click Export in the Operation column.
Method 2
1. Log in to the TencentDB for MySQL console, select Parameter Templates on the left sidebar, click the parameter
template name or View Details in the Operation column in the template list, and enter the parameter template details
page.
2. Select More > Export Parameters at the top.

Deleting a Parameter Template
If a parameter template is created redundantly or no longer needed, it can be easily deleted.
1. Log in to the TencentDB for MySQL console and select Parameter Templates on the left sidebar.
2. In the parameter template list, locate the desired template and click Delete in the Operation column.
3. Click OK in the pop-up dialog box.

See Also
For suggestions for configuration of key parameters, see Suggestions on Parameter Settings.

©2013-2022 Tencent Cloud. All rights reserved.

Page 229 of 461

TencentDB for MySQL

Comparison of Different Template Parameters：

Last updated 2024-07-22 15:41:51
You can compare custom parameter templates with other custom templates or default templates to view theirdifferences in the TencentDB for MySQL console.

Directions
1. Log in to the TencentDB for MySQL console, select Parameter Template on the left sidebar, select the custom
templates to be compared, and click Compare.

2. In the pop-up dialog box, select the target templates to be compared through Select Parameter Template.

3. View the comparison result.

©2013-2022 Tencent Cloud. All rights reserved.

Page 230 of 461

TencentDB for MySQL©2013-2022 Tencent Cloud. All rights reserved.

Page 231 of 461

TencentDB for MySQL

Performance Comparison of Parameter
Templates：

Last updated 2024-07-22 15:42:05

Test Tool
Sysbench 1.0.20 is the tool used to test the database benchmark performance.
Tool installation
Run the following code to install Sysbench 1.0.20:©2013-2022 Tencent Cloud. All rights reserved.

Page 232 of 461

TencentDB for MySQL

git clone https://github.com/akopytov/sysbench.git
git checkout 1.0.20
yum install gcc gcc-c++ autoconf automake make libtool bzr mysql-devel git mysql
cd sysbench./autogen.sh./configure
make -jmake installNote:©2013-2022 Tencent Cloud. All rights reserved.

Page 233 of 461

TencentDB for MySQLThe installation directions above apply to performance stress testing on a CentOS CVM instance. For directions on
installing the tool on other operating systems, see the official Sysbench documentation.

Test Environment
Type

Description

Test instanceThree common specifications, namely, 4-core CPU and 8 GB memory, 8-core CPU andspecification

32 GB memory, and 16-core CPU and 128 GB memory

Clientconfiguration

64-core CPU and 128 GB memory

Client private
network bandwidth

23 Gbps

Test data volume

Database instance memory * 1.2

Test databaseinstance versions

5.6 20210630, 5.7 20210630, and 8.0 20210330

Note on client specification: High-spec client machines are used so as to ensure that the database instance
performance can be measured through stress testing on a single client. For low-spec clients, we recommend you use
multiple clients for concurrent stress testing and aggregate the results.
Note on network latency: When performing the test, make sure that clients and database instances are in the same AZ
to prevent the testing result from being affected by network factors.

Test Method
Test data preparations©2013-2022 Tencent Cloud. All rights reserved.

Page 234 of 461

TencentDB for MySQL

sysbench --db-driver=mysql --mysql-host=xxxx --mysql-port=xxxx --mysql-user=xxxx --Command for performance stress testing©2013-2022 Tencent Cloud. All rights reserved.

Page 235 of 461

TencentDB for MySQL

sysbench --db-driver=mysql --mysql-host=xxxx --mysql-port=xxxx --mysql-user=xxxx -Descriptions of stress testing parameters:
oltp_read_write indicates to implement the OLTP test by calling the/usr/share/sysbench/oltp_read_write.lua script.
--tables=xxxx indicates the number of tables in this test.
--table_size=xxxx indicates the number of table rows in this test.
--threads=xxxx indicates the number of concurrent connections of the client in this test.
--report-interval=1 indicates that the test result is output once every second.

©2013-2022 Tencent Cloud. All rights reserved.

Page 236 of 461

TencentDB for MySQL--percentile=95 indicates the sampling rate, which is 95% by default.
--time=600 indicates the execution time of this test, which is 600 seconds.

Scenario model
The test cases in this document all use the Lua script of sysbench.
For the common configurations, performance testing is conducted for different parameter templates. The test results
are as follows:

Test result
v5.6 20210630
CPU(Core)

Memory(GB)

Threads

Test
Duration

Template
Default template(disused)

4

8

32

10 minHigh-performanceparameter template
High-stability
parameter template
Default template(disused)

8

32

64

10 minHigh-performanceparameter template
High-stability
parameter template
Default template(disused)

16

128

128

10 minHigh-performanceparameter template
High-stability
parameter template

SysBench
QPS

SysBench
TPS

34428.69

1721.4335917.50

1795.8734834.04

1741.70

61210.19

3060.51

67719.55

3385.98

64910.09

3245.50

106965.44

5348.27

127955.48

6397.77

119509.02

5975.45

avg_lat
18.59
ms
17.82
ms
18.37
ms
20.91
ms
18.90
ms
19.72
ms
23.93
ms
20.00
ms
21.41
ms

v5.7 20210630©2013-2022 Tencent Cloud. All rights reserved.

Page 237 of 461

TencentDB for MySQLCPUMemory(Core)(GB)

Threads

Test

Template

SysBench

SysBench

QPS

TPS

34428.69

1721.4335917.50

1795.8734834.04

1741.70

61210.19

3060.51

67719.55

3385.98

64910.09

3245.50

106965.44

5348.27

127955.48

6397.77

119509.02

5975.45

SysBench

SysBench

QPS

TPS

32594.79

1629.7433383.77

1669.1932071.90

1603.60

Default template(disused)

65718.22

3285.9119.47
ms

High-performance

70195.37

3509.77

18.23

Duration
Default template(disused)

4

8

32

10 minHigh-performanceparameter template
High-stability
parameter template
Default template(disused)

8

32

64

10 minHigh-performanceparameter template
High-stability
parameter template
Default template(disused)

16

128

128

10 minHigh-performanceparameter template
High-stability
parameter templateavg_lat

18.59
ms
17.82
ms
18.37
ms
20.91
ms
18.90
ms
19.72
ms
23.93
ms
20.00
ms
21.41
ms

v8.0 20210330
CPU

Memory(Core)(GB)

Threads

Test
Duration

Template
Default template(disused)

4

8

32

10 minHigh-performanceparameter template
High-stability
parameter template

8

32

64

10 min©2013-2022 Tencent Cloud. All rights reserved.

avg_lat
19.63
ms
19.17
ms
19.95
ms

Page 238 of 461

TencentDB for MySQL

parameter template
High-stability
parameter template
Default template(disused)
16

128

128

10 minHigh-performanceparameter template
High-stability
parameter template©2013-2022 Tencent Cloud. All rights reserved.

ms60704.69

3035.23132023.66

6601.18

151021.67

7551.08

132391.01

6619.55

21.08
ms
19.38
ms
16.95
ms
19.33
ms

Page 239 of 461

TencentDB for MySQL

Suggestions on Parameter Configuration：

Last updated 2024-07-22 15:42:17
Parameters in TencentDB for MySQL have been optimized on the basis of official default values in MySQL. We
recommend that you configure the following parameters for your TencentDB for MySQL instance after purchase
based on your business scenarios.

character_set_server
Default value: UTF8
Restart required: Yes
Description: Configure the default character set for the MySQL server. TencentDB for MySQL offers four character
sets: LATIN1, UTF8, GBK, and UTF8MB4. Among them, LATIN1 supports English characters, with one character
having one byte; UTF8 is generally used for international encoding that contains all characters used by all countries,
with one character having three bytes; in GBK, every character has two bytes; and UTF8MB4 (a superset of UTF8) iscompletely backward compatible and supports emojis, with one character having four bytes.
Recommendation: After purchasing an instance, you need to select the appropriate character set based on the data
format required in your business to ensure that the client and the server use the same character set, preventing
garbled text and unnecessary restarts.

lower_case_table_names
Default value: 0
Restart required: Yes
Description: When creating a database or table, you can set whether storage and query operations are case-sensitive.
This parameter can be set to 0 (case-sensitive) or 1 (case-insensitive). The default value is 0.
Recommendation: TencentDB for MySQL is case-sensitive by default. We recommend that you configure thisparameter based on your business needs and usage habits.

sql_mode
Default values:©2013-2022 Tencent Cloud. All rights reserved.

Page 240 of 461

TencentDB for MySQLNO_ENGINE_SUBSTITUTION (v5.6); ONLY_FULL_GROUP_BY, STRICT_TRANS_TABLES, NO_ZERO_IN_
Restart required: No
Description: TencentDB for MySQL can operate in different SQL modes, which define the SQL syntax and data checkthat it should support.
The default value of this parameter on v5.6 is NO_ENGINE_SUBSTITUTION , indicating that if the used storageengine is disabled or not compiled, an error will be reported.
On v5.7 and v8.0, the default values are ONLY_FULL_GROUP_BY, STRICT_TRANS_TABLES ,NO_ZERO_IN_DATE, NO_ZERO_DATE , ERROR_FOR_DIVISION_BY_ZERO , NO_AUTO_CREATE_USER ,©2013-2022 Tencent Cloud. All rights reserved.

Page 241 of 461

TencentDB for MySQL

and NO_ENGINE_SUBSTITUTION .
Here:
ONLY_FULL_GROUP_BY means that in a GROUP BY operation, the column in SELECT or the HAVING or ORDER
BY subquery must be a function column that appears in or relies on GROUP BY.
STRICT_TRANS_TABLES enables strict SQL mode. NO_ZERO_IN_DATE controls whether the server permits
dates in which the year part is nonzero but the month or day part is zero. The effect of NO_ZERO_IN_DATE
depends on whether strict SQL mode is enabled.
NO_ZERO_DATE controls whether the server permits a zero date as valid. Its effect depends on whether strict SQL
mode is enabled.
ERROR_FOR_DIVISION_BY_ZERO means that in strict SQL mode, if data is divided by zero during the INSERT or
UPDATE process, an error rather than a warning will be generated, while in non-strict SQL mode, NULL will be
returned.
NO_AUTO_CREATE_USER prohibits the GRANT statement from creating a user with an empty password.
NO_ENGINE_SUBSTITUTION means that if the storage engine is disabled or not compiled, an error will bereported.
Recommendation: As different SQL modes support different SQL syntax, we recommend that you configure thembased on your business needs and development habits.

long_query_time
Default value: 10
Restart required: No
Description: Used to define the time threshold for slow queries, with the default value as 10s. If a query execution
takes 10s or longer, the execution details will be recorded in the slow log for future analysis.
Recommendation: As business scenarios and performance sensitivity may vary, we recommend that you set the value
in consideration of future performance analysis.

©2013-2022 Tencent Cloud. All rights reserved.

Page 242 of 461

TencentDB for MySQLIntelligent Parameter Tuning：

Last updated 2023-11-15 16:03:25
This document describes how to implement intelligent parameter tuning in the TencentDB for MySQL console.

BackgroundThe concept of "deep learning" has been gaining popularity among general users. As relevant technologies are getting
more mature, the TencentDB team is thinking about how to use deep learning to improve the operating efficiency of
databases. The first thing that comes to mind is database parameter tuning. Due to the huge differences in businesssystems, it is impossible to perform targeted tuning in a fine-grained manner like optimizing SQL, which is a challenge
for DBAs. They often have to draw upon their experience to build a set of better performing parameter templates. The
ability to tune database parameters is more like an exclusive skill of expert DBAs.
Between 2019 and 2021, the TencentDB team published two papers entitled "Automatic Database Tuning Using
Deep Reinforcement Learning" and "An Online Cloud Database Hybrid Tuning System for Personalized
Requirements" respectively, and applied for international patents for the theory. Now, the theory is developed into a
usable system based on the papers, which improves the database performance by tuning parameters in real-world
use cases.
Why database parameter tuning?
High numbers of parameters: For example, MySQL has hundreds of configuration items, so tuning is difficult.
High labor costs: A full-time DBA is required, and expert experience is needed, which incur high labor costs.
Poor tool universality: Existing tools have limited features and involve time-consuming operations, producing a poor
effect.
New requirements in the cloud: Some users don't have a full-time Ops team, making it impossible to implement
parameter tuning.

Prerequisites
You have a running TencentDB for MySQL instance.

Use Limits
Scenario-based intelligent tuning can be performed only three times per instance per month. This limit is reset on thefirst day of each month.

©2013-2022 Tencent Cloud. All rights reserved.

Page 243 of 461

TencentDB for MySQL

AI-based intelligent analysis (coming soon) can be performed only once per instance per month. This limit is reset on
the first day of each month.
Intelligent parameter tuning can be performed only for instances with at least four CPU cores.
The intelligent parameter tuning task list keeps only the last 15 tuning results.
When an instance is terminated/returned or expires, any ongoing intelligent parameter tuning task in it will be
automatically aborted and deleted.
Only one tuning task can be executed per instance at any time.
The intelligent parameter tuning feature currently is supported only in Beijing, Shanghai, and Guangzhou regions andwill be available in more regions in the future.

Directions
Previously purchased MySQL instance
1. Log in to the TencentDB for MySQL console and select a region at the top. In the instance list, click an instance ID
or Manage in the Operation column to enter the instance management page.
2. On the instance management page, select Database Management > Parameter Settings > Intelligent
Parameter Tuning.

3. In the Intelligent Parameter Tuning pop-up window, select Scenario-Based Intelligent Tuning or AI-BasedIntelligent Analysis as the tuning method and click Analyze.

©2013-2022 Tencent Cloud. All rights reserved.

Page 244 of 461

TencentDB for MySQL

If you select Scenario-Based Intelligent Tuning, follow the steps below:
Scenario-based intelligent tuning: An efficient and targeted intelligent analysis based on your selected scenario.
Select a business scenario in the Scenario drop-down list, which can be Order Transactions, OLTP
Performance Test, or Pressure Test.
After selecting a scenario, you can customize the business ratio in the scenario for more accurate system analysis.
Then, click Analyze.
Order Transactions (TPCC)
Customizable items: Order processing (high), Payment (high), Order query (low), Logistics (low), Warehousing (low)Data Reading Mode: Cache (default), Disk + Cache
Concurrency: Low, Middle, High (default)
OLTP Performance Test (Sysbench)
Customizable items: Reading data (high), Writing data (none by default)
Data Reading Mode: Cache (default), Disk + Cache
Concurrency: Low, Middle, High (default)
Pressure Test (myslap)
Concurrency: Low, Middle, High (default)©2013-2022 Tencent Cloud. All rights reserved.

Page 245 of 461

TencentDB for MySQL

If you select AI-Based Intelligent Analysis (coming soon), follow the steps below:
AI-Based Intelligent Analysis: The database business type is determined through in-depth analysis of database
operating metrics, the performance of different parameters in specific scenarios is analyzed with deep learningalgorithms, and then parameter suggestions are presented.
After selecting AI-Based Intelligent Analysis, click Analyze.

：

Note

The AI-based intelligent analysis is under improvement and will be available soon.
This is a time-consuming intelligent analysis based on deep learning algorithm and big data analytics. We recommend
you perform it during off-peak hours.
4. The parameter tuning task starts when the analysis starts. You can select Intelligent Parameter Tuning > View
Task on the Parameter Settings page to view the task details.

©2013-2022 Tencent Cloud. All rights reserved.

Page 246 of 461

TencentDB for MySQL

5. After the parameter tuning task is completed, you can click View Results in the Operation column in Intelligent
Parameter Tuning > View Task.

6. After confirming the parameter tuning recommendations, click Apply to Instance.

©2013-2022 Tencent Cloud. All rights reserved.

Page 247 of 461

TencentDB for MySQL

7. Confirm the parameter change in the pop-up window, select the Execution Mode, read and indicate your consent
to the Restart Rules, and click OK.
Execution mode:
Immediate execution: The change will be applied to the instance immediately after the confirmation.
During maintenance time: The change will be applied to the instance during the maintenance time, which can be
modified on the Instance Details page.

Newly purchased MySQL instance
When purchasing a TencentDB for MySQL instance, after selecting a parameter template, you can choose whether toenable Scenario-Based Intelligent Tuning. If this feature is enabled, the system will perform secondary adjustment
according to the selected business scenario, which can be Order Transactions, OLTP Performance Test, or
Pressure Test.
You can view the change results in Parameter Settings > Intelligent Parameter Tuning > View Task.

©2013-2022 Tencent Cloud. All rights reserved.

Page 248 of 461

TencentDB for MySQL©2013-2022 Tencent Cloud. All rights reserved.

Page 249 of 461

TencentDB for MySQL

Modification Records of System Parameter
Templates：

Last updated 2024-02-18 11:28:56
TencentDB for MySQL provides system parameter templates for batch parameter settings. The parameters in systemparameter templates may be optimized and updated with MySQL iteration. This document describes the update
history of the parameters in system parameter templates.
Note:
If the parameters in the template are updated, the instance parameters are not updated unless they are manually reapplied to the instances. You can apply the parameter changes to single or multiple instances by importing a template.
For directions on how to use system parameter templates, see Managing Parameter Template.

January 2024
Parameter

MySQL
5.6

MySQL
5.7

MySQL
8.0

Change Description
Changes in Default Value of
thread_pool_oversubscribe Parameter inthread_pool_oversubscribe

✓

✓

✓

High-Performance Parameter Templates
for MySQL 5.6, 5.7, 8.0.
Previous Default Value: 10
Updated Default Value: 16

December 2023
Parameter

thread_pool_oversubscribe

MySQL
5.6

✓

©2013-2022 Tencent Cloud. All rights reserved.

MySQL
5.7

✓

MySQL
8.0

Change Description✓

The default value for the parameter'thread_pool_oversubscribe' has been
modified.
Previous Default Value: 3
Updated Default Value: 10

Page 250 of 461

TencentDB for MySQL

August 2023
Parameter

MySQL

MySQL

5.7

8.0

Change Description
The default value for the parameter'innodb_fast_ahi_cleanup_for_drop_table'

innodb_fast_ahi_cleanup_for_drop_table✓✓has been altered.
Previous Default Value: OFF
Updated Default Value: ON

June 2023
Parameter

MySQL

MySQL

MySQL

MySQL

5.5

5.6

5.7

8.0

Change Description
Modification of Default Value for thetime_zone✓✓✓'time_zone' Parameter
Previous Default Value: SYSTEM
Updated Default Value: +8:00✓

May 2023
Parameter

innodb_async_truncate_work_enabled

MySQL

MySQL

5.7

8.0

✓

-

Change Description
5.7 Version Asynchronous Table Deletion
Function Switch Parameter Modification
The parameter has been changed frominnodb_async_truncate_work_enabled toinnodb_table_drop_mode. (May 15, 2023)

innodb_parallel_ddl-✓

Parameter Deprecation (May 5, 2023)

March 2023
Parameter

MySQL

MySQL

5.7

8.0

©2013-2022 Tencent Cloud. All rights reserved.

Change Description

Page 251 of 461

TencentDB for MySQL

innodb_temp_data_file_path✓✓

Modification of Default Value for
innodb_temp_data_file_path Parameter
Prior Default Value ibtmp1:12M:autoextend：：

Altered Default Value
ibtmp1:12M:autoextend:max:1048576M

January 2023
Parameter

MySQL

MySQL

5.7

8.0

Change Description
Dynamic setting is supported for max_execution_time
Restart required: No

max_execution_time✓✓

Default value: 0
Value range: 0–4294967295
Unit: ms

August 2022
Parameter

MySQL
5.7

MySQL
8.0

Change Description
Dynamic setting is supported for
innodb_buffer_pool_size
Restart required: No

innodb_buffer_pool_size✓✓

Default value: {DBInitMemory * 786432}
Value range: {DBInitMemory * 524288} - {DBInitMemory *943718}DBinitMemory: An integer of instance memory size

July 2022
Parameter

MySQL
5.7

MySQL
8.0

innodb_temp_data_file_path✓✓©2013-2022 Tencent Cloud. All rights reserved.

Change Description
Parameter modification is supported for
innodb_temp_data_file_path (temp

Page 252 of 461

TencentDB for MySQL

tablespace size) and the parameter properties are as
follows:
Restart required: Yes
Default value: ibtmp1:12M:autoextend
Value range of ibtmp : 12 MB - 1024 MB. After you
select autoextend , the maximum value can be set
to 2097152 MB

March 2022
Parameter

MySQL
5.6

MySQL
5.7

MySQL
8.0

Change Description

innodb_open_files

✓

✓

✓

Removedinnodb_stats_sample_pages

-

✓

✓

Removed

wait_timeout

✓

✓

✓

New value range: 1–31536000

thread_cache_size

✓

✓

✓

New value range: 1–16384

December 2021
Parameter

MySQL
5.6

MySQL
5.7

MySQL
8.0

Change Description
Default value: FULL . For the early createdbinlog_row_image✓&#10003✓

instances, the default value is MINIMAL .
Manual modification is supported.

November 2020
Parameter

MySQL
8.0

Change Description

iinnodb_flush_log_at_trx_commit✓

Parameter added

sync_binlog✓

Parameter added

local_infile✓

Parameter added©2013-2022 Tencent Cloud. All rights reserved.

Page 253 of 461

TencentDB for MySQL

innodb_log_file_size✓

Parameter added

cdb_recycle_bin_enabled✓

Parameter added

binlog_format✓

New value range: row

innodb_autoinc_lock_mode✓

New default value: 2table_open_cache✓

New default value: 2000

slave_pending_jobs_size_max✓

New default value: 1073741824

time_zone&#10003

New value range: [SYSTEM|-12:00|-11:00|-10:00|-09:00|-08:00|-05:00|-04:00|-03:00|-02:00|-01:00|+00:00|+01:00|+02:00|+03:0+05:30|+06:00|+06:30|+07:00|+08:00|+09:00|+10:00|+11:00|+12

max_connections&#10003

New value range: 1–100000

slave_rows_search_algorithms&#10003

New default value: TABLE_SCAN,INDEX_SCAN,HASH_SCAN

innodb_open_files&#10003

New default value: 10240

slave_parallel_type&#10003

New value range: LOGICAL_CLOCK|TABLE|DATABASE

August 2020
Parameter

MySQL
5.6

MySQL
5.7

Change Description

log_warnings✓✓

Parameter added

innodb_flush_log_at_trx_commit✓✓

Parameter added

sync_binlog✓✓

Parameter added

local_infile✓✓

Parameter added

innodb_log_file_size✓✓

Parameter added

binlog_format✓✓

New range value: row

innodb_autoinc_lock_mode✓✓

New default value: 2

innodb_open_files✓✓

New value range: 1–102400

table_open_cache✓✓

New default value: 2000

©2013-2022 Tencent Cloud. All rights reserved.

Page 254 of 461

TencentDB for MySQL

slave_pending_jobs_size_max✓✓

New default value: 1 GB

time_zone✓✓

New value range: [SYSTEM|-12:00|-11:00|-10:0-05:00|-04:00|-03:00|-02:00|-01:00|+00:00|+01:0+05:30|+06:00|+06:30|+07:00|+08:00|+09:00|+1

max_connections✓✓

New value range: 1–100000

cdb_more_gtid_feature_supported-✓

All kernel features supported

cdb_more_gtid_feature_supported&#10003-

New default value: offslave_parallel_workers-✓

All kernel features supported

tls_version-✓

Removedslave_rows_search_algorithms✓✓

New default value: TABLE_SCAN,INDEX_SCAN

innodb_open_files✓&#10003

New default value: 10240

August 2020
Parameter

MySQL
5.5

Change Description

innodb_autoinc_lock_mode&#10003

New default value: TABLE_SCAN,INDEX_SCAN,HASH_SCAN

innodb_open_files&#10003

New default value: 10240©2013-2022 Tencent Cloud. All rights reserved.

Page 255 of 461

TencentDB for MySQL

Network and Security
Access Management
Overview：

Last updated 2024-07-22 15:54:11

IssuesIf you have multiple users managing different Tencent Cloud services such as CVM, VPC, and TencentDB, and they
all share your Tencent Cloud account access key, you may face the following problems:Your key will be easily compromised because it is shared by several users.
You cannot restrict the access from other users and your service will be vulnerable to the security risks caused bytheir maloperations.

Solution
You can avoid the problems above by allowing different users to manage different services through sub-accounts. By
default, a sub-account does not have permissions to use Tencent Cloud services or resources. Therefore, you need tocreate a policy to grant different permissions to the sub-accounts.
Cloud Access Management (CAM) is a web-based Tencent Cloud service that helps you securely manage and control
access permissions to your Tencent Cloud resources. Using CAM, you can create, manage, and terminate users(groups), and control the Tencent Cloud resources that can be used by the specified user through identity and policy
management.
When using CAM, you can associate a policy with a user or user group to allow or forbid them to use specified
resources to complete specified tasks. For more information on CAM policies, see Element Reference.
You can skip this section if you do not need to manage permissions to TencentDB resources for sub-accounts. This
will not affect your understanding and use of the other sections of the document.

Getting started
A CAM policy must authorize or deny the use of one or more TencentDB operations. At the same time, it must specify
the resources that can be used for the operations (which can be all resources or partial resources for certain
operations). A policy can also include the conditions set for the manipulated resources.
Note:
We recommend that you manage TencentDB resources and authorize TencentDB operations through CAM policies.
Although the user experience does not change for existing users who are granted permissions by project, we do not©2013-2022 Tencent Cloud. All rights reserved.

Page 256 of 461

TencentDB for MySQL

recommend that you continue to manage resources and authorize operations in a project-based manner.
Effectiveness conditions cannot be set in TencentDB for the time being.
Task

Link

Basic policy structure

Policy syntax

Operation definition in a policy

Operations in TencentDB

Resource definition in a policy

Resources in TencentDB

Resource-level permission supported by TencentDB

List of APIs supporting authorization at resource level

Console examples

Console examples©2013-2022 Tencent Cloud. All rights reserved.

Page 257 of 461

TencentDB for MySQL

Authorization Policy Syntax：

Last updated 2024-07-22 15:54:25

Policy syntax
CAM policy:{©2013-2022 Tencent Cloud. All rights reserved.

Page 258 of 461

TencentDB for MySQL"version":"2.0","statement":[{"effect":"effect","action":["action"],"resource":["resource"],"condition": {"key":{"value"}}}]}version is required. Currently, only the value "2.0" is allowed.
statement describes the details of one or more permissions. This element contains a permission or permission set ofother elements such as effect , action , resource , and condition . One policy has only one
statement.
effect is required. It describes whether the declaration result is allow or explicit deny .
action is required. It specifies whether to allow or deny the operation. The operation can be an API (prefixed with
"cdb:").
resource is required. It describes the details of authorization. A resource is described in a six-segment format.
Detailed resource definitions vary by product.
condition is required. It describes the condition for the policy to take effect. A condition consists of operator, action
key, and action value. A condition value may contain information such as time and IP address. Some services allow
you to specify additional values in a condition.

Operations in TencentDB
In a TencentDB policy statement, you can specify any API operation from any service that supports TencentDB. APIs
prefixed with cdb: should be used for TencentDB, such as cdb:CreateDBInstance or
cdb:CreateAccounts .
To specify multiple operations in a single statement, separate them by comma.

©2013-2022 Tencent Cloud. All rights reserved.

Page 259 of 461

TencentDB for MySQL"action":["cdb:action1","cdb:action2"]
You can also specify multiple operations by using a wildcard. For example, you can specify all operations beginningwith "Describe" in the name.

©2013-2022 Tencent Cloud. All rights reserved.

Page 260 of 461

TencentDB for MySQL"action":["cdb:Describe*"]To specify all operations in TencentDB, use the * wildcard.

©2013-2022 Tencent Cloud. All rights reserved.

Page 261 of 461

TencentDB for MySQL"action":["cdb:*"]Resources in TencentDB
Each CAM policy statement has its own applicable resources.
Resources are generally in the following format:©2013-2022 Tencent Cloud. All rights reserved.

Page 262 of 461

TencentDB for MySQL

qcs:project_id:service_type:region:account:resource
project_id describes the project information, which is only used to enable compatibility with legacy CAM logic andcan be left empty.
service_type describes the product abbreviation such as cdb .
region describes the region information, such as ap-guangzhou .
account describes the root account of the resource owner, such as uin/65xxx763 .
resource describes detailed resource information of each product, such as instanceId/instance_id1 or
instanceId/* .

©2013-2022 Tencent Cloud. All rights reserved.

Page 263 of 461

TencentDB for MySQLFor example, you can specify a resource for a specific instance (cdb-k05xdcta) in a statement.

"resource":[ "qcs::cdb:ap-guangzhou:uin/65xxx763:instanceId/cdb-k05xdcta"]
You can also use the wildcard "*" to specify it for all instances that belong to a specific account.

©2013-2022 Tencent Cloud. All rights reserved.

Page 264 of 461

TencentDB for MySQL"resource":[ "qcs::cdb:ap-guangzhou:uin/65xxx763:instanceId/*"]If you want to specify all resources or a specific API operation does not support resource-level permission control, you
can use the * wildcard in the resource element.

©2013-2022 Tencent Cloud. All rights reserved.

Page 265 of 461

TencentDB for MySQL"resource": ["*"]To specify multiple resources in one policy, separate them by comma. In the following example, two resources are
specified:©2013-2022 Tencent Cloud. All rights reserved.

Page 266 of 461

TencentDB for MySQL"resource":["resource1","resource2"]
The table below describes the resources that can be used by TencentDB and the corresponding resource description
methods, where words prefixed with $ are placeholders, region refers to a region, and account refers toan account ID.
Resource

Resource Description Method in Authorization Policy

Instance

qcs::cdb:$region:$account:instanceId/$instanceId

VPC

qcs::vpc:$region:$account:vpc/$vpcId©2013-2022 Tencent Cloud. All rights reserved.

Page 267 of 461

TencentDB for MySQL

Security groupqcs::cvm:$region:$account:sg/$sgId©2013-2022 Tencent Cloud. All rights reserved.

Page 268 of 461

TencentDB for MySQL

Authorizable Resource Types：

Last updated 2024-07-22 15:54:38
Resource-level permission can be used to specify which resources a user can manipulate. TencentDB supports
certain resource-level permissions. This means that for TencentDB operations that support resource-level permission,
you can control the time when a user is allowed to perform operations or to use specified resources. The following
table describes the types of resources that can be authorized in CAM.
Resource Type

Resource Description Method in Authorization Policy

TencentDB

qcs::cdb:$region:$account:instanceId/*

instance-related

qcs::cdb:$region:$account:instanceId/$instanceId

The table below lists the TencentDB API operations which currently support resource-level permission control as wellas the resources and condition keys supported by each operation. You can use the * wildcard in a resource pathwhen defining it.

List of APIs supporting resource-level authorization
API
AddTimeWindow

AssociateSecurityGroups

CloseWanService

CreateAccounts

CreateBackup

CreateDBImportJob

DeleteAccounts©2013-2022 Tencent Cloud. All rights reserved.

Resource Path
qcs::cdb:$region:$account:instanceId/*
qcs::cdb:$region:$account:instanceId/$instanceId
qcs::cdb:$region:$account:instanceId/*
qcs::cdb:$region:$account:instanceId/$instanceId
qcs::cdb:$region:$account:instanceId/*
qcs::cdb:$region:$account:instanceId/$instanceId
qcs::cdb:$region:$account:instanceId/*
qcs::cdb:$region:$account:instanceId/$instanceId
qcs::cdb:$region:$account:instanceId/*
qcs::cdb:$region:$account:instanceId/$instanceId
qcs::cdb:$region:$account:instanceId/*
qcs::cdb:$region:$account:instanceId/$instanceId
qcs::cdb:$region:$account:instanceId/*
qcs::cdb:$region:$account:instanceId/$instanceId

Page 269 of 461

TencentDB for MySQL

DeleteBackup

qcs::cdb:$region:$account:instanceId/*
qcs::cdb:$region:$account:instanceId/$instanceId

DeleteTimeWindow

DescribeAccountPrivileges

DescribeAccounts

DescribeBackupConfig

DescribeBackupDatabases

DescribeBackupDownloadDbTableCode

DescribeBackups

DescribeBackupTables

DescribeBinlogs

DescribeDatabases

DescribeDBImportRecords

DescribeDBInstanceCharset

DescribeDBInstanceConfig

DescribeDBInstanceGTID
DescribeDBInstanceRebootTime©2013-2022 Tencent Cloud. All rights reserved.

qcs::cdb:$region:$account:instanceId/*
qcs::cdb:$region:$account:instanceId/$instanceId
qcs::cdb:$region:$account:instanceId/*
qcs::cdb:$region:$account:instanceId/$instanceId
qcs::cdb:$region:$account:instanceId/*
qcs::cdb:$region:$account:instanceId/$instanceId
qcs::cdb:$region:$account:instanceId/*
qcs::cdb:$region:$account:instanceId/$instanceId
qcs::cdb:$region:$account:instanceId/*
qcs::cdb:$region:$account:instanceId/$instanceId
qcs::cdb:$region:$account:instanceId/*
qcs::cdb:$region:$account:instanceId/$instanceId
qcs::cdb:$region:$account:instanceId/*
qcs::cdb:$region:$account:instanceId/$instanceId
qcs::cdb:$region:$account:instanceId/*
qcs::cdb:$region:$account:instanceId/$instanceId
qcs::cdb:$region:$account:instanceId/*
qcs::cdb:$region:$account:instanceId/$instanceId
qcs::cdb:$region:$account:instanceId/*
qcs::cdb:$region:$account:instanceId/$instanceId
qcs::cdb:$region:$account:instanceId/*
qcs::cdb:$region:$account:instanceId/$instanceId
qcs::cdb:$region:$account:instanceId/*
qcs::cdb:$region:$account:instanceId/$instanceId
qcs::cdb:$region:$account:instanceId/*
qcs::cdb:$region:$account:instanceId/$instanceId
qcs::cdb:$region:$account:instanceId/*
qcs::cdb:$region:$account:instanceId/$instanceId
qcs::cdb:$region:$account:instanceId/*

Page 270 of 461

TencentDB for MySQL

qcs::cdb:$region:$account:instanceId/$instanceId
DescribeDBSwitchRecords

DescribeDBSecurityGroups

DescribeInstanceParamRecords

DescribeInstanceParams

DescribeRoGroups

DescribeRollbackRangeTime

DescribeSlowLogs

DescribeSupportedPrivileges

DescribeTables

DescribeTimeWindow

DescribeDatabasesForInstances

DescribeMonitorData

DescribeTableColumns

DropDatabaseTables

InitDBInstances©2013-2022 Tencent Cloud. All rights reserved.

qcs::cdb:$region:$account:instanceId/*
qcs::cdb:$region:$account:instanceId/$instanceId
qcs::cdb:$region:$account:instanceId/*
qcs::cdb:$region:$account:instanceId/$instanceId
qcs::cdb:$region:$account:instanceId/*
qcs::cdb:$region:$account:instanceId/$instanceId
qcs::cdb:$region:$account:instanceId/*
qcs::cdb:$region:$account:instanceId/$instanceId
qcs::cdb:$region:$account:instanceId/*
qcs::cdb:$region:$account:instanceId/$instanceId
qcs::cdb:$region:$account:instanceId/*
qcs::cdb:$region:$account:instanceId/$instanceId
qcs::cdb:$region:$account:instanceId/*
qcs::cdb:$region:$account:instanceId/$instanceId
qcs::cdb:$region:$account:instanceId/*
qcs::cdb:$region:$account:instanceId/$instanceId
qcs::cdb:$region:$account:instanceId/*
qcs::cdb:$region:$account:instanceId/$instanceId
qcs::cdb:$region:$account:instanceId/*
qcs::cdb:$region:$account:instanceId/$instanceId
qcs::cdb:$region:$account:instanceId/*
qcs::cdb:$region:$account:instanceId/$instanceId
qcs::cdb:$region:$account:instanceId/*
qcs::cdb:$region:$account:instanceId/$instanceId
qcs::cdb:$region:$account:instanceId/*
qcs::cdb:$region:$account:instanceId/$instanceId
qcs::cdb:$region:$account:instanceId/*
qcs::cdb:$region:$account:instanceId/$instanceId
qcs::cdb:$region:$account:instanceId/*
qcs::cdb:$region:$account:instanceId/$instanceId

Page 271 of 461

TencentDB for MySQLIsolateDBInstance

qcs::cdb:$region:$account:instanceId/*
qcs::cdb:$region:$account:instanceId/$instanceId

ModifyAccountDescription

ModifyAccountPassword

ModifyAccountPrivileges

ModifyAutoRenewFlag

ModifyBackupConfig

ModifyBackupInfo

ModifyDBInstanceName

ModifyDBInstanceProject

ModifyDBInstanceSecurityGroups

ModifyDBInstanceVipVport

ModifyInstanceParam

ModifyDBInstanceModes

ModifyTimeWindow

ModifyProtectMode
OfflineDBInstances

qcs::cdb:$region:$account:instanceId/*
qcs::cdb:$region:$account:instanceId/$instanceId
qcs::cdb:$region:$account:instanceId/*
qcs::cdb:$region:$account:instanceId/$instanceId
qcs::cdb:$region:$account:instanceId/*
qcs::cdb:$region:$account:instanceId/$instanceId
qcs::cdb:$region:$account:instanceId/*
qcs::cdb:$region:$account:instanceId/$instanceId
qcs::cdb:$region:$account:instanceId/*
qcs::cdb:$region:$account:instanceId/$instanceId
qcs::cdb:$region:$account:instanceId/*
qcs::cdb:$region:$account:instanceId/$instanceId
qcs::cdb:$region:$account:instanceId/*
qcs::cdb:$region:$account:instanceId/$instanceId
qcs::cdb:$region:$account:instanceId/*
qcs::cdb:$region:$account:instanceId/$instanceId
qcs::cdb:$region:$account:instanceId/*
qcs::cdb:$region:$account:instanceId/$instanceId
qcs::cdb:$region:$account:instanceId/*
qcs::cdb:$region:$account:instanceId/$instanceId
qcs::cdb:$region:$account:instanceId/*
qcs::cdb:$region:$account:instanceId/$instanceId
qcs::cdb:$region:$account:instanceId/*
qcs::cdb:$region:$account:instanceId/$instanceId
qcs::cdb:$region:$account:instanceId/*
qcs::cdb:$region:$account:instanceId/$instanceId
qcs::cdb:$region:$account:instanceId/*
qcs::cdb:$region:$account:instanceId/$instanceId
qcs::cdb:$region:$account:instanceId/*
qcs::cdb:$region:$account:instanceId/$instanceId©2013-2022 Tencent Cloud. All rights reserved.

Page 272 of 461

TencentDB for MySQL

qcs::cdb:$region:$account:instanceId/*

OpenDBInstanceGTID

qcs::cdb:$region:$account:instanceId/$instanceId
qcs::cdb:$region:$account:instanceId/*

OpenWanService

qcs::cdb:$region:$account:instanceId/$instanceId
qcs::cdb:$region:$account:instanceId/*

ReleaseIsolatedDBInstances

qcs::cdb:$region:$account:instanceId/$instanceId
qcs::cdb:$region:$account:instanceId/*

RestartDBInstances

qcs::cdb:$region:$account:instanceId/$instanceId
qcs::cdb:$region:$account:instanceId/*

StartBatchRollback

qcs::cdb:$region:$account:instanceId/$instanceId
qcs::cdb:$region:$account:instanceId/*

SubmitBatchOperation

qcs::cdb:$region:$account:instanceId/$instanceId
qcs::cdb:$region:$account:instanceId/*

SwitchDrInstanceToMaster

qcs::cdb:$region:$account:instanceId/$instanceId
qcs::cdb:$region:$account:instanceId/*

SwitchForUpgrade

qcs::cdb:$region:$account:instanceId/$instanceId
qcs::cdb:$region:$account:instanceId/*

DisassociateSecurityGroups

qcs::cdb:$region:$account:instanceId/$instanceId
qcs::cdb:$region:$account:instanceId/*

UpgradeDBInstance

qcs::cdb:$region:$account:instanceId/$instanceId
qcs::cdb:$region:$account:instanceId/*

UpgradeDBInstanceEngineVersion

qcs::cdb:$region:$account:instanceId/$instanceId

List of APIs not supporting resource-level authorization
For TencentDB API operations that don't support resource-level authorization, you can still authorize a user to performthem, but you must specify * as the resource element in the policy statement.
API

Description

CreateDBInstance

Creates a monthly subscribed TencentDB instance

CreateDBInstanceHour

Creates a pay-as-you-go TencentDB instance©2013-2022 Tencent Cloud. All rights reserved.

Page 273 of 461

TencentDB for MySQL

CreateParamTemplate

Creates a parameter template

DeleteParamTemplate

Deletes a monitoring template item

DescribeProjectSecurityGroups

Queries the security group information of a project

DescribeDefaultParams

Queries the list of default configurable parameters

DescribeParamTemplateInfo

Queries the details of a parameter template

DescribeParamTemplates

Queries the list of parameter templates

DescribeAsyncRequestInfo

Queries the execution result of an async task

DescribeTasks

Queries the list of tasks for a TencentDB instanceDescribeUploadedFiles

Queries the list of imported SQL files

ModifyParamTemplate

Modifies a parameter template

RenewDBInstanceRenews a TencentDB instance

StopDBImportJob

Stops a data import task

DescribleRoMinScale

Queries the minimum specification supported by a read-only instanceDescribeRequestResult

Queries the details of a task

DescribeRoMinScale

Queries the minimum specification for read-only instance purchase or
upgrade©2013-2022 Tencent Cloud. All rights reserved.

Page 274 of 461

TencentDB for MySQL

Console Examples：

Last updated 2024-07-22 15:54:53
This document provides examples about how to grant a user permissions to view and use specific resources in theTencentDB console by using a CAM policy.

Full access policy for TencentDB
To grant a user permissions to create and manage TencentDB instances, you can implement the
QcloudCDBFullAccess policy for the user.
Log in to the CAM console, select Policies on the left sidebar, and search QcloudCDBFullAccess in the upper rightcorner.

The policy syntax is as follows:©2013-2022 Tencent Cloud. All rights reserved.

Page 275 of 461

TencentDB for MySQL{"statement": [{"action": ["cdb:*"],"effect": "allow","resource": "*"},{"action": [©2013-2022 Tencent Cloud. All rights reserved.

Page 276 of 461

TencentDB for MySQL"vpc:*"],"effect": "allow","resource": "*"},{"action": ["cvm:*"],"effect": "allow","resource": "qcs::cvm:::sg/*"},{"action": ["cos:*"],"effect": "allow","resource": "*"},{"action": ["monitor:*","cam:ListUsersForGroup","cam:ListGroups","cam:GetGroup"],"effect": "allow","resource": "*"},{"action": ["kms:CreateKey","kms:GenerateDataKey","kms:Decrypt","kms:ListKey"],"effect": "allow","resource": "*"}],"version": "2.0"}
The above policy achieves its goal by allowing the user to separately authorize the use of TencentDB, VPC, security
group, COS, KMS, and all resources available in the monitor with the CAM policy.

©2013-2022 Tencent Cloud. All rights reserved.

Page 277 of 461

TencentDB for MySQL

Read-only permission policy for TencentDB
To grant a user permission to view TencentDB instances but not create, delete, or modify them, you can implement
the policy named QcloudCDBInnerReadOnlyAccess for the user.
Note:
We recommend that you configure the read-only policy for TencentDB.
Log in to the CAM console, select Policies on the left sidebar, click Service Type in the policy list and selectTencentDB for MySQL in the drop-down list, and then you can see this policy in the results.
The policy syntax is as follows:©2013-2022 Tencent Cloud. All rights reserved.

Page 278 of 461

TencentDB for MySQL{"statement": [{"action": ["cdb:Describe*"],"effect": "allow","resource": "*"}],"version": "2.0"}

Read-only permission policy for TencentDB-related resources
To grant a user permissions to view TencentDB instances and related resources (VPC, security groups, COS, andCloud Monitor) but not create, delete, or modify them, you can implement the QcloudCDBReadOnlyAccesspolicy for the user.
Log in to the CAM console, select Policies on the left sidebar, click Service Type in the policy list and selectTencentDB for MySQL in the drop-down list, and then you can see this policy in the results.
The policy syntax is as follows:©2013-2022 Tencent Cloud. All rights reserved.

Page 279 of 461

TencentDB for MySQL{"statement": [{"action": ["cdb:Describe*"],"effect": "allow","resource": "*"},{"action": [©2013-2022 Tencent Cloud. All rights reserved.

Page 280 of 461

TencentDB for MySQL"monitor:Describe*","monitor:Get*","cam:ListUsersForGroup","cam:ListGroups","cam:GetGroup"],"effect": "allow","resource": "*"}],"version": "2.0"}
The above policy achieves its goal by allowing the user to separately authorize the use of the following operations with
the CAM policy.
All operations in TencentDB that begin with "Describe".
All operations in VPC that begin with "Describe", "Inquiry", or "Get".
All operations in security groups that begin with "DescribeSecurityGroup".
All operations in COS that begin with "List", "Get", and "Head" as well as the "OptionsObject" operation.
All operations in the monitor.

Policy for granting a user permissions to use APIs not at theresource level
To grant a user permissions to use only APIs not at the resource level, you can implement the
QcloudCDBProjectToUser policy for the user.
Log in to the CAM console, select Policies on the left sidebar, click Service Type in the policy list and selectTencentDB for MySQL in the drop-down list, and then you can see this policy in the results.
The policy syntax is as follows:©2013-2022 Tencent Cloud. All rights reserved.

Page 281 of 461

TencentDB for MySQL{"version": "2.0","statement": [{"action": ["cdb:BalanceRoGroupLoad","cdb:CancelBatchOperation","cdb:CreateBatchJobFiles","cdb:CreateDBInstance","cdb:CreateDBInstanceHour","cdb:CreateMonitorTemplate",©2013-2022 Tencent Cloud. All rights reserved.

Page 282 of 461

TencentDB for MySQL"cdb:CreateParamTemplate","cdb:DeleteBatchJobFiles","cdb:DeleteMonitorTemplate","cdb:DeleteParamTemplate","cdb:DescribeBatchJobFileContent","cdb:DescribeBatchJobFiles","cdb:DescribeBatchJobInfo","cdb:DescribeProjectSecurityGroups","cdb:DescribeDefaultParams","cdb:DescribeMonitorTemplate","cdb:DescribeParamTemplateInfo","cdb:DescribeParamTemplates","cdb:DescribeRequestResult","cdb:DescribeRoGroupInfo","cdb:DescribeRoMinScale","cdb:DescribeTasks","cdb:DescribeUploadedFiles","cdb:ModifyMonitorTemplate","cdb:ModifyParamTemplate","cdb:ModifyRoGroupInfo","cdb:ModifyRoGroupVipVport","cdb:StopDBImportJob","cdb:UploadSqlFiles"],"effect": "allow","resource": "*"}]}Policy for granting a user permissions to manipulate a specificTencentDB instanceTo grant a user the permission to manipulate a specific TencentDB instance, associate the following policy with theuser. For example, the policy below allows the user to manipulate the TencentDB instance "dcdb-xxx" in Guangzhou
region.

©2013-2022 Tencent Cloud. All rights reserved.

Page 283 of 461

TencentDB for MySQL{"version": "2.0","statement": [{"action": "cdb:*","resource": "qcs::cdb:ap-guangzhou::instanceId/cdb-xxx","effect": "allow"}]}©2013-2022 Tencent Cloud. All rights reserved.

Page 284 of 461

TencentDB for MySQL

Policy for granting a user permissions to manipulate TencentDB
instances in batches
To grant a user permissions to manipulate TencentDB instances in batches, associate the following policy with theuser. For example, the policy below allows the user to manipulate the TencentDB instances "cdb-xxx" and "cdb-yyy" in
Guangzhou region and "cdb-zzz" in Beijing region.

{"version": "2.0",©2013-2022 Tencent Cloud. All rights reserved.

Page 285 of 461

TencentDB for MySQL"statement": [{"action": "cdb:*","resource": ["qcs::cdb:ap-guangzhou::instanceId/cdb-xxx", "qcs::cdb:ap"effect": "allow"}]}

Policy for granting a user permissions to manipulate TencentDB
instances in a specific region
To grant a user permissions to manipulate TencentDB instances in a specific region, associate the following policy
with the user. This policy authorizes the user to operate TencentDB instances in Guangzhou region.

©2013-2022 Tencent Cloud. All rights reserved.

Page 286 of 461

TencentDB for MySQL{"version": "2.0","statement": [{"action": "cdb:*","resource": "qcs::cdb:ap-guangzhou::*","effect": "allow"}]}©2013-2022 Tencent Cloud. All rights reserved.

Page 287 of 461

TencentDB for MySQL

Custom policy
If preset policies cannot meet your requirements, you can create custom policies as shown below. If permissions are
granted by resources, for a TencentDB API operation that does not support authorization at the resource level, you
can still authorize a user to perform it, but you must specify * as the resource element in the policy statement.
The syntax of custom policies is as follows:{"version": "2.0","statement": [©2013-2022 Tencent Cloud. All rights reserved.

Page 288 of 461

TencentDB for MySQL{"action": ["Action"],"resource": "Resource","effect": "Effect"}]}
Replace "Action" with the operation to be allowed or denied.
Replace "Resource" with the resources that you want to authorize the user to manipulate.
Replace "Effect" with "Allow" or "Deny".

©2013-2022 Tencent Cloud. All rights reserved.

Page 289 of 461

TencentDB for MySQL

TencentDB Security Group Management：

Last updated 2024-07-22 15:55:06

Overview
Security group serves as a stateful virtual firewall with filtering feature for configuring network access control for one ormore TencentDB instances. It is an important network security isolation tool provided by Tencent Cloud. Instanceswith the same network security isolation demands in one region can be put into the same security group, which is alogical group. TencentDB and CVM share the security group list and are matched with each other within the security
group based on rules. For specific rules and limitations, see Security Group Overview.
Note:
TencentDB for MySQL security groups currently only support network access control for VPCs and public networks
but not the classic network.
As TencentDB doesn't have any active outbound traffic, outbound rules don't apply to it.
Security groups are supported for source, read-only, and disaster recovery TencentDB for MySQL instances.

Configuring a security group for TencentDB
Step 1. Create a security group
1. Log in to the CVM console.
2. Select Security Group on the left sidebar, select a region, and click Create.
3. In the pop-up dialog window, configure the following items, and click OK.
Template: Select a template based on the service to be deployed on the TencentDB instance in the security group,
which simplifies the security group rule configuration, as shown in the table below.
Template
Open all ports

Open ports 22, 80, 443, and3389 and the ICMP protocol

Description
All ports are opened to the public and private
networks. This may pose security issues.
Ports 22, 80, 443, and 3389 and the ICMP
protocol are opened to the public network. All
ports are opened to the private network.

Description-

This template doesn’t takeeffect for TencentDB.

You can create a security group and then add
Customcustom rules. For more information, see Add a-security group rule.

©2013-2022 Tencent Cloud. All rights reserved.

Page 290 of 461

TencentDB for MySQLName: Custom name of the security group.
Project: Select a project for easier management. By default, DEFAULT PROJECT is selected.
Remarks: A short description of the security group for easier management.

Step 2. Add a security group rule
1. On the Security Group page, click Modify Rule in the Operation column on the row of the security group for whichto configure a rule.
2. On the security group rule page, click Inbound Rules > Add Rule.
3. In the pop-up window, set the rule.
Type: Custom is selected by default. You can also choose another system rule template. MySQL(3306) isrecommended.
Source or Target: Traffic source (inbound rules) or target (outbound rules). You need to specify one of the following
options:
Source or Target

Description
In CIDR notation, such as 203.0.113.0, 203.0.113.0/24 or

A single IPv4 address or an IPv4 range

0.0.0.0/0, where 0.0.0.0/0 indicates all IPv4 addresses
will be matched.
In CIDR notation, such as FF05::B5, FF05:B5::/60, ::/0 or

A single IPv6 address or an IPv6 range

0::0/0, where ::/0 or 0::0/0 indicates all IPv6 addresses
will be matched.

ID of referenced security group. You can reference
the ID of:Current security group indicates the CVM associated withthe security group.

Current security group

Other security group indicates the ID of another security

Other security group

group under the same project in the same region.

Reference an IP address object or IP addressgroup object in a parameter template.

-

Protocol Port: Enter the protocol type and port range or reference a protocol/port or protocol/port group in aparameter template.
Note:
To connect to a TencentDB for MySQL instance, you must open its port. You can log in to the TencentDB for MySQL
console, click an instance ID to enter the instance details page.

©2013-2022 Tencent Cloud. All rights reserved.

Page 291 of 461

TencentDB for MySQL

TencentDB for MySQL uses private network port 3306 by default and supports customizing the port. If the default port
is changed, the new port should be opened in the security group.
The TencentDB for MySQL public port is automatically assigned by the system and cannot be customized. After the
public network access is enabled, it will be controlled by the ACL of the security group. When configuring the security
policy, you need to open the private port 3306.
The security group rules displayed on the Security Group page in the TencentDB for MySQL console take effect for
private and public (if enabled) network addresses of the TencentDB for MySQL instance.
Policy: Allow or Reject. Allow is selected by default.
Allow: Traffic to this port is allowed.
Reject: Data packets will be discarded without any response.
Remarks: A short description of the rule for easier management.
4. Click Complete.
Use case
Scenario: You have created a TencentDB for MySQL instance and want to access it from a CVM instance.
Solution: When adding security group rules, select MySQL(3306) in Type to open port 3306.
You can also set Source to all or specific IPs (IP ranges) as needed to allow them to access TencentDB for MySQL
from a CVM instance.
| Inbound or Outbound | Type | Source | Protocol and Port | Policy || Inbound | MySQL(3306) | All IPs: 0.0.0.0/0
Specific IPs: Specify IPs or IP ranges | TCP:3306 | Allow |Step 3. Configure a security group
A security group is an instance-level firewall provided by Tencent Cloud for controlling inbound traffic of TencentDB.
You can associate a security group with an instance when purchasing it or later in the console.
Note:
Currently, security groups can be configured only for TencentDB for MySQL instances in VPC.
1. Log in to the TencentDB for MySQL console, click an instance ID in the instance list, and enter the instancemanagement page.
2. On the Security Group tab, click Configure Security Group.
3. In the pop-up dialog box, select the security group to be bound and click OK.

©2013-2022 Tencent Cloud. All rights reserved.

Page 292 of 461

TencentDB for MySQL

Importing security group rules
1. On the Security Group page, click the ID/name of the target security group.
2. On the inbound rule or outbound rule tab, click Import Rule.
3. In the pop-up window, select an edited inbound/outbound rule template file and click Import.
Note:
As existing rules will be overwritten after importing, we recommend that you export the existing rules before importing
new ones.

Cloning a security group
1. On the Security Group page, locate the target security group and click More > Clone in the Operation column.
2. In the pop-up window, select the target region and project and click OK. If the new security group needs to be
associated with a CVM instance, do so by managing the CVM instances in the security group.

Deleting a security group
1. On the Security Group page, locate the security group to be deleted and click More > Delete in the Operation
column.
2. In the pop-up window, click OK. If the current security group is associated with a CVM instance, it must be
disassociated first before being deleted.

©2013-2022 Tencent Cloud. All rights reserved.

Page 293 of 461

TencentDB for MySQL

Enabling Public Network Address：

Last updated 2024-07-05 09:14:59
This document introduces how to manually enable or disable the public network address through the TencentDB for
MySQL console, to facilitate public access to the MySQL instance. Using the system-assigned domain name andport, you can connect to the database via a public network address. Once the public network is enabled, it isconvenient for daily testing and management, thereby enhancing the convenience for users in development and use.
Note:
Failures of public network access will not be counted in the overall availability calculation of the TencentDB for MySQL
service.
Public network access to your TencentDB for MySQL instance poses a risk to its security, hence it is advisable toemploy it solely for administrative purposes, testing, or auxiliary database management. The availability of the Service
Level Agreement (SLA) cannot be ensured in this context. For business access, please select private network access.

Precautions
After enabling public network access, TencentDB for MySQL instances switch to a CLB architecture, and the system
automatically creates a basic CLB instance in the same region on the CLB Console, to provide public network
capabilities. Be aware of the resource limitation policies of the CLB architecture (as shown in the table below). For
higher performance requirements, you can also directly purchase a CLB.

Classification

Number ofConcurrent
Connections

Number ofNew
Connections

Packet Volume

InboundBandwidth

OutboundBandwidth

CLB

2000

200/s

Unlimited

20 Mbps

20 MbpsNote:
The CLB instance automatically created upon enabling the public network address can be tried for free.
After disabling the public network address, the corresponding CLB instance on the CLB console will be automaticallydeleted.
Starting mid-May 2024, the CLB health check source IP will be in the 100.64.0.0/10 subnet. Once the public network
is enabled, if your simple CLB instance shows an abnormal health status, you can allow the 100.64.0.0/10 subnet in
the security group settings for your TencentDB for MySQL instance to resolve the issue of failed health checks©2013-2022 Tencent Cloud. All rights reserved.

Page 294 of 461

TencentDB for MySQL

causing the CLB instance to display an abnormal health status. Please refer to Manage Cloud Database Security
Groups for operations.

You need to configure monitoring and alarms for the above-mentioned simple CLB instances, to monitor public
network connections through metrics (such as the number of new public network connections established, number ofpublic network connections, public network outbound bandwidth, and public network inbound bandwidth) after
enabling the public network address. Refer to Alarm Policy for operation steps, and select the policy type as shown in
the following figure.

Use Limitations
Currently, the primary instance regions of Guangzhou, Shanghai, Beijing, Chengdu, Chongqing, Nanjing, Hong Kong
(China), Singapore, Seoul, Tokyo, Silicon Valley, Virginia, and Frankfurt support enabling the public network. For
regions where read-only instances can enable the public network, refer to the console. If your instance's region does
not support enabling but requires the public network, see Enable Public Network Access through CLB to access
TencentDB for MySQL instance via the public network.

Enable the Public Network Address
1. Log in to the TencentDB for MySQL console. In the instance list, click an instance ID or Manage in the Operation
column to access the instance details page.
2. Under Public Network Address on the instance details page, click Enable.

©2013-2022 Tencent Cloud. All rights reserved.

Page 295 of 461

TencentDB for MySQL

3. In the pop-up window, click OK.

：

Note

After the public network address is enabled, it can be found in the basic information section.
The public network connection can be disabled through the switch. After it is re-enabled, the public network address
corresponding to the domain name remains the same.

Disable the Public Network Address
1. Log in to MySQL Console, in the Instance List, click Instance ID or Manage in the Operate column to enter the
Instance Details page.
2. On the Instance Details page, click Off behind the Public Network Address.
3. In the pop-up window, confirm that everything is correct, and click OK.
4. Return to the Instance Details page, the Public Network Address will no longer display the public network
address, indicating that the public network feature is turned off.

©2013-2022 Tencent Cloud. All rights reserved.

Page 296 of 461

TencentDB for MySQL

Network Switch：

Last updated 2024-07-22 15:55:22

Overview
Tencent Cloud supports classic network and VPC as described in Overview, which are capable of offering a diversityof smooth services. On this basis, we provide more flexible services as shown below to help you manage network
connectivity with ease.
Network switch
Switch from classic network to VPC: A single TencentDB source instance can be switched from classic network to
VPC.
Switch from VPC A to VPC B: A single TencentDB source instance can be switched from VPC A to VPC B.
Custom IP and port
Custom source instance IP and port: The IP and port of a source instance can be customized on the instance details
page in the console.
Custom read-only instance IP and port: The IP and port of a read-only instance can be customized on the instancedetails page in the console.

Notes
After the switch from classic network to VPC, only clients in the same VPC can interconnect with each other. You canconfigure a VPC IP range to keep the VPC IP the same as the classic network IP.
The repossession time for the old IP is 24 hours by default and can be up to 168 hours. If "Valid Hours of Old IP" is set
to 0 hours, the IP is released immediately after the network is changed.
The switch from classic network to VPC is irreversible. After the switch to a VPC, the TencentDB instance cannot
communicate with Tencent Cloud services in another VPC or classic network.
The network switch of a primary instance doesn't apply to its associated read-only instances or disaster recovery
instances, you need to manually switch the network for these instances.

Subnet Description
A subnet is a logical network space in a VPC. You can create subnets in different AZs in the same VPC, which
communicate with each other over the private network by default.

©2013-2022 Tencent Cloud. All rights reserved.

Page 297 of 461

TencentDB for MySQL

After you select a network, the subnet IPs in the AZ of the selected instance are displayed by default. You can also
select subnet IPs in other AZs in the region of the instance. Business connections adopt nearby access, so the
network latency will not be increased.

Directions
Switching the network
1. Log in to the TencentDB for MySQL console. In the instance list, click an instance ID or Manage in the Operation
column to enter the instance details page.
2. Click Switch to VPC or Change Network after Network in the Basic Info section.
3. In the pop-up window, select a VPC and a subnet and click OK.
Note:
If there is no IP address specified, one will be automatically assigned by the system.
You can only select a VPC in the region of the instance, but you can choose a subnet in any AZ and view its IP range.
We recommend that you select a VPC in the region where the CVM instance resides; otherwise, the CVM instance will
not be able to access TencentDB for MySQL over the private network, unless a peering connection or a CCN instanceis created between the two VPCs.
Switch from classic network to VPC©2013-2022 Tencent Cloud. All rights reserved.

Page 298 of 461

TencentDB for MySQL

Switch from VPC A to VPC B

4. Return to the instance details page where you can view the network of the instance.

Switching the RO group network
1. Log in to the TencentDB for MySQL console. In the instance list, click an instance ID or Manage in the Operation
column to enter the instance details page.
2. In the RO Group Info of a read-only instance, click Change Subnet or Switch to VPC according to the network
switch type (classic network to VPC or VPC to VPC).
3. In the pop-up window, select a VPC and a subnet and click OK.
Note:
If there is no IP address specified, one will be automatically assigned by the system.
You can only select a VPC in the region of the instance, but you can choose a subnet in any AZ and view its IP range.
We recommend you select a VPC in the region where the CVM instance resides; otherwise, the CVM instance will not
be able to access TencentDB for MySQL over the private network, unless a peering connection or a CCN instance iscreated between the two VPCs.

Customizing the IP and port
1. Log in to the TencentDB for MySQL console. In the instance list, click an instance ID or Manage in the Operation
column to enter the instance details page.
2. Click©2013-2022 Tencent Cloud. All rights reserved.

Page 299 of 461

TencentDB for MySQL

after Private Network Address and Private Port in the Basic Info section.
Note:
Modifying the private network address and port affects the database business being accessed.
3. In the pop-up window, specify the IP and port and click OK.

©2013-2022 Tencent Cloud. All rights reserved.

Page 300 of 461

TencentDB for MySQL

Enabling Public Network Access Through
CLB：

Last updated 2024-05-23 21:38:27
TencentDB for MySQL supports both private and public network addresses, with the former enabled by default for you
to access your instance over the private network and the latter enabled or disabled as needed. To access yourdatabase instance from a Linux or Windows CVM instance over the public network, you can enable the public network
address. You can also enable public network access through CLB, but you must configure security group rules in thiscase.
This document describes how to enable public network access through CLB and connect to an instance through
MySQL Workbench.

Prerequisites
You have applied for using the backend service feature.
1. Go to the Cross-Region CLB Binding 2.0 Application page.
2. Fill out and submit the application.
3. Upon completion of the beta application submission, submit a ticket to CLB to apply for access to the backend
service features.
Note:
Enabling the public network services through CLB is exclusively applicable when the CLB instances and the MySQL
instances belong to the same VPC network. It is currently not supported for instances across different VPC networks.

Step 1. Purchase a CLB instanceNote:
If you already have a CLB instance in the same region as TencentDB for MySQL, skip this step.
Go to the CLB purchase page, select the configuration, and click Buy Now.
Note:
Region: You need to select the region where the TencentDB for MySQL instance is.

Step 2. Configure the CLB instance©2013-2022 Tencent Cloud. All rights reserved.

Page 301 of 461

TencentDB for MySQLThe following describes how to configure the CLB instance in the same VPC as the database instance and in adifferent VPC respectively.

Scenario: Deploying the CLB instance in the same VPC as the TencentDB for MySQL
instance
1. Enable cross-VPC access so that the CLB instance can be bound to another private IP.
a. Log in to the CLB console, select the region, and click the target instance ID in the instance list to enter the instancemanagement page.
b. On the Basic Info page, click Configure in the Real Server section.
c. In the pop-up window, click Submit.
2. Configure a public network listener port.
a. Log in to the CLB console, select the region, and click the target instance ID in the instance list to enter the instancemanagement page.
b. On the instance management page, select the Listener Management tab and click Create below TCP/UDP/TCP
SSL Listener.
c. In the pop-up window, complete the settings and click Submit.

Step 3. Bind a TencentDB for MySQL instance
1. After creating the listener, click it in Listener Management and click Bind on the right.
2. In the pop-up window, select Other Private IPs as the object type, enter the IP address and port of the TencentDB
for MySQL instance, and click OK.
Note:
The login account must be a standard account (bill-by-IP). If binding fails, submit a ticket for assistance.

Step 4. Configure the TencentDB for MySQL security group
1. Log in to the TencentDB for MySQL console and select a region. In the instance list, click an instance ID or
Manage in the Operation column to enter the instance management page.
2. On the instance management page, select the Security Group tab, click Configure Security Group, configure
the security group rule to open all ports, and confirm that the security group allows access from public IPs. For more
information on configuration, see TencentDB Security Group Management.

©2013-2022 Tencent Cloud. All rights reserved.

Page 302 of 461

TencentDB for MySQL

Step 5. Connect to the instance through the MySQL Workbenchclient
1. Download MySQL Workbench from MySQL Community Downloads and install it.
1. Go to the download page and click MySQL Workbench.
2. Click Download after Windows (x86, 64-bit), MSI Installer.
3. Click No thanks, just start my download.
4. After MySQL Workbench is installed, open it and click the plus sign after MySQL Connections to add theinformation of the target instance.

5. In the pop-up window, configure the following items and click OK.

©2013-2022 Tencent Cloud. All rights reserved.

Page 303 of 461

TencentDB for MySQLParameter

Description

Connection
Name

Name the connection.

Connection
MethodSelect **Standard (TCP/IP)**.

HostnameEnter the address of the CLB instance. You can view the VIP information in the basic informationon the CLB instance details page.

Port

Enter the port of the CLB instance. You can view the TCP port number in listener management on
the CLB instance details page.

UsernameEnter the account name of the target MySQL instance, i.e., the account created in **Database
Management** > **Account Management** on the instance management page.

Store in
Vault...

Enter the account password of the target MySQL instance in the **Password** field and save it.

6. Return to the MySQL Workbench homepage and click the just configured instance to connect to it.

©2013-2022 Tencent Cloud. All rights reserved.

Page 304 of 461

TencentDB for MySQL

7. The UI after successful connection is as follows:©2013-2022 Tencent Cloud. All rights reserved.

Page 305 of 461

TencentDB for MySQL

Enabling Transparent Data Encryption：

Last updated 2024-07-22 15:55:36

Overview
TencentDB for MySQL comes with the transparent data encryption (TDE) feature. Transparent encryption means thatthe data encryption and decryption are transparent to users. TDE supports real-time I/O encryption and decryption ofdata files. It encrypts data before it is written to disk, and decrypts data when it is read into memory from disk, whichmeets the compliance requirements of static data encryption.

Prerequisites
The instance architecture must be two-node/three-node.
The database version must be MySQL 5.7 or 8.0.
You have activated Key Management Service (KMS). If not, you can enable it as instructed during the TDE activation
process.
You have granted KMS key permissions. If not, you can grant permissions as instructed during the TDE activation
process.
Your account needs the QcloudAccessForMySQLRole permission. To do so, you can follow the instructions
provided during the TDE activation process.
Note:-The keys used for encryption are generated and managed by
KMS. TencentDB for MySQL does not provide keys or certificates required for encryption.
TDE does not incur fees, but KMS may. For more information, see KMS Billing Overview.
If your account has overdue payment, you can’t get keys from KMS, which may cause instance migration and upgradetasks to fail. For more information, see Payment Overdue.

Use Limits
Once the authorization is revoked, MySQL databases will be inaccessible upon restart.
TDE can’t be disabled once enabled.
Once TDE is enabled, you need to decrypt data before you can restore it to a local database.

©2013-2022 Tencent Cloud. All rights reserved.

Page 306 of 461

TencentDB for MySQLTDE enhances the security of static data while compromising the read-write performance of encrypted databases.
Therefore, use it based on your actual needs.
If the source instance is associated with a read-only or disaster recovery instance, you only need to enable TDE for
the source instance, which will then be automatically enabled for its associated instances.
After TDE is enabled, if your account has overdue payment, you cannot get keys from KMS, which may cause
migration, upgrade, and other tasks to fail.
After TDE is enabled, more CPU resources will be consumed, and about 5% of the performance will be compromised.
After TDE is enabled, authenticated applications and users can access the data transparently.

Directions
Enabling TDE
1. Log in to the TencentDB for MySQL console. In the instance list, click an instance ID or Manage in the Operation
column to enter the instance management page.
2. On the Data Security tab, toggle on Encryption Status.
Note:
An instance with TDE enabled cannot be restored from a physical backup to a self-created database on anotherserver.
TDE can't be disabled once enabled.

3. In the pop-up dialog box, activate the KMS, grant the KMS key permissions, select a key, and click Encrypt.
If you select Use key auto-generated by Tencent Cloud, the key will be auto-generated by Tencent Cloud.

©2013-2022 Tencent Cloud. All rights reserved.

Page 307 of 461

TencentDB for MySQL

If you select Use existing custom key, you can select a key created by yourself.
Note:
If there are no custom keys, click go to create to create keys in the KMS console. For more information, see Creating
a Key.

©2013-2022 Tencent Cloud. All rights reserved.

Page 308 of 461

TencentDB for MySQL

Encrypting a table
Once you enable TDE, you can encrypt a table of a MySQL instance by running the example DDL statements on thetable.
To encrypt a table upon creation, run the following statement:©2013-2022 Tencent Cloud. All rights reserved.

Page 309 of 461

TencentDB for MySQLCREATE TABLE t1 (c1 INT) ENCRYPTION='Y';
To encrypt an existing table, run the following statement:©2013-2022 Tencent Cloud. All rights reserved.

Page 310 of 461

TencentDB for MySQLALTER TABLE t1 ENCRYPTION='Y';

Decrypting a table
Once you enable TDE, you can decrypt a table of a MySQL instance by running the example DDL statement on thetable.
To decrypt an encrypted table, run the following statement:©2013-2022 Tencent Cloud. All rights reserved.

Page 311 of 461

TencentDB for MySQLALTER TABLE t1 ENCRYPTION='N';©2013-2022 Tencent Cloud. All rights reserved.

Page 312 of 461

TencentDB for MySQL

Setting SSL Encryption：

Last updated 2024-07-25 14:07:20

SSL encryption overview
Secure Sockets Layer (SSL) authentication is a process that authenticates the connection from the user client to theTencentDB server. After SSL encryption is enabled, you can get a CA certificate and upload it to the server. Then,
when the client accesses the database, the SSL protocol will be activated to establish an SSL secure channel
between the client and the server. This implements encrypted data transfer, prevents data from being intercepted,
tampered with, and eavesdropped during transfer, and ultimately ensures the data security for both the client and theserver.
The SSL protocol needs to be established based on reliable TCP and has the advantage of being independent fromapplication layer protocols; therefore, high-level application layer protocols such as HTTP, FTP, and TELNET can betransparently established on it. It completes encryption algorithm processing, communication key negotiation, andserver authentication before communication is made over application layer protocols. After that, all data transferredover application layer protocols will be encrypted to ensure communication privacy.

Background
When you connect to a database in an unencrypted manner, all information transferred over the network will be inplaintext and may be eavesdropped, tampered with, and impersonated by malicious users. The SSL protocols aredesigned to address these risks and can bring the following benefits theoretically:
Information is encrypted and cannot be eavesdropped by a third party.
There is a verification mechanism for immediate tampering detection by both parties in the communication.
Identity certificates will be used to authenticate the identity.
TencentDB for MySQL supports enhancing the connection security by enabling SSL encryption as well as
downloading and installing SSL CA certificates to the required application services.

：

Note

SSL encryption protects the traffic between the database and the server rather than the data itself. Encrypting the
network connection at the transport layer can improve the security and integrity of the communication data, but will
increase the response time of the network connection.

Prerequisites©2013-2022 Tencent Cloud. All rights reserved.

Page 313 of 461

TencentDB for MySQLThe instance version is MySQL 5.6/5.7/8.0.
The instance architecture is two-node/three-node.
The instance engine is InnoDB/RocksDB.

Supported Versions
MySQL uses OpenSSL to implement secure connections. TencentDB for MySQL supports Transport Layer Security
Protocol (TLS) versions 1.0, 1.1, 1.2, and 1.3, depending on the MySQL version. The following table shows the
MySQL versions that support TLS.
MySQL Version

TLS1.0

TLS1.1TLS1.2

TLS1.3MySQL 5.7

Not Supported

Not Supported

Supported

Supported

MySQL 8.0

Supported

Supported

Supported

Supported

Enabling SSL encryption
1. Log in to the TencentDB for MySQL console. In the instance list, click an instance ID or Manage in the Operation
column to enter the instance management page.
2. On the instance management page, select the Data Security > SSL tab.

3. This feature is disabled by default. Toggle it on and click OK.
The window to enable SSL encryption in the source instance is as follows:

：

Note

©2013-2022 Tencent Cloud. All rights reserved.

Page 314 of 461

TencentDB for MySQL

During the process of enabling SSL encryption, your database instance will be restarted to load the SSL certificate.
Make sure that your business has a reconnection mechanism.
The window to enable SSL encryption in a read-only instance is as follows:

：

Note

The configuration of the SSL encryption feature in a read-only instance will be synced to other read-only instances in
its read-only group.
4. Click Download to download the SSL CA certificate.The certificate has a validity period of 20 years.
The downloaded file is a compressed package (TencentDB-CA-Chain.zip), which contains the following three files:.p7b file: It is used to import the CA certificate into Windows.
.jks file: It is the truststore certificate storage file in Java and always has the password tencentdb . It is used toimport the CA certificate chain into Java.
.pem file: It is used to import the CA certificate into other systems or applications.

Configuring an SSL CA certificate
After enabling SSL encryption, you need to configure an SSL CA certificate when using a client to connect toTencentDB. The following takes Navicat as an example to describe how to install an SSL CA certificate. For otherapplications or clients, refer to their respective documentation.

：

Note

Every time SSL encryption is enabled or disabled for TencentDB for MySQL, a new certificate will be generated.
1. Open Navicat.
2. Right-click the target database and select Edit Connection.
3. Select the SSL tab, select the path of the CA certificate in .pem format, complete the settings, and click OK.

©2013-2022 Tencent Cloud. All rights reserved.

Page 315 of 461

TencentDB for MySQL

：

Note

If the error message connection is being used is displayed, it may be because the previous session has
not been disconnected. In this case, restart Navicat and try again.
4. Double-click the target database to test whether the connection is normal.

Disabling SSL encryption
1. Log in to the TencentDB for MySQL console. In the instance list, click an instance ID or Manage in the Operation
column to enter the instance management page.
2. On the instance management page, select the Data Security > SSL tab.
3. Toggle the switch off and click OK in the pop-up window.

：

Note

During the process of disabling SSL encryption, your database instance will be restarted to uninstall the SSL
certificate. Make sure that your business has a reconnection mechanism.

Use the MySQL command-line client to enable the SSL-encrypted
instance
If your database version is different, the connection command parameters of the MySQL client will be different. You
can use the following command to query the database version you are using, and then refer to the subsequent steps toconnect to the instance.

©2013-2022 Tencent Cloud. All rights reserved.

Page 316 of 461

TencentDB for MySQLSELECT VERSION();
Query Result Example:+--------------+| VERSION()|+--------------+| 8.0.30-txsql |+--------------+
1 row in set (0.00 sec)

©2013-2022 Tencent Cloud. All rights reserved.

Page 317 of 461

TencentDB for MySQL

1. Download the SSL CA certificate through the TencentDB for MySQL console. For operations, refer to Enable SSL
Encryption.
2. Using the MySQL command-line client to enable the SSL-encrypted instance through the command.
For the MariaDB client, connect to the instances using the following command.

mysql -h <IP address> --ssl-ca=<CA certificate> --ssl -P <Port number> -u < usernam
When the client database version is MySQL 5.6, use the following command to connect to the instance.

©2013-2022 Tencent Cloud. All rights reserved.

Page 318 of 461

TencentDB for MySQL

mysql -P <Port number> -h <IP address>-u < username > -p< password > --ssl-ca<CA

When the client database version is MySQL 5.7/8.0, use the following command to connect to the instance.

©2013-2022 Tencent Cloud. All rights reserved.

Page 319 of 461

TencentDB for MySQL

mysql -h <IP address> --ssl-ca=<CA certificate> --ssl-mode=REQUIRED -P <Port number
To use other SSL modes, such as VERIFY_CA or VERIFY_IDENTITY, connect to the instance using the following
command.

©2013-2022 Tencent Cloud. All rights reserved.

Page 320 of 461

TencentDB for MySQL

mysql -h <IP address> --ssl-ca=<CA certificate> --ssl-mode=VERIFY_CA -P <Port numbe
Note:
The --ssl-mode parameter indicates the SSL mode. Generally, REQUIRED and VERIFY_CA modes arerecommended. These modes require the MySQL client to use the SSL/TLS protocol to connect to the MySQL server
and to verify the SSL/TLS certificate of the MySQL server. The VERIFY_IDENTITY mode, in addition to verifying the
SSL/TLS certificate of the MySQL server, requires that the hostname used by the client matches the identifier in theserver certificate; otherwise, the MySQL client will refuse to connect to the MySQL server.
3. Enter the password for the corresponding username as prompted by the system.

©2013-2022 Tencent Cloud. All rights reserved.

Page 321 of 461

TencentDB for MySQL

Sample code for connecting to an SSL-enabled instance from
common programs
PHP©2013-2022 Tencent Cloud. All rights reserved.

Page 322 of 461

TencentDB for MySQL$conn = mysqli_init();
mysqli_ssl_set($conn,NULL,NULL, "<path of the downloaded certificate>", NULL, NULL)
mysqli_real_connect($conn, '<database access address>', '<database access username>if (mysqli_connect_errno($conn)) {die('Failed to connect to MySQL: '.mysqli_connect_error());}
PHP (Using PDO)

©2013-2022 Tencent Cloud. All rights reserved.

Page 323 of 461

TencentDB for MySQL$options = array(
PDO::MYSQL_ATTR_SSL_CA => '<path of the downloaded certificate>');$db = new PDO('mysql:host=<database access address>;port=<access port>;dbname=<theJava (MySQL Connector for Java)©2013-2022 Tencent Cloud. All rights reserved.

Page 324 of 461

TencentDB for MySQL# generate truststore and keystore in code
String importCert = " -import "+" -alias mysqlServerCACert "+" -file " + ssl_ca +" -keystore truststore "+" -trustcacerts " +" -storepass password -noprompt ";String genKey = " -genkey -keyalg rsa " +" -alias mysqlClientCertificate -keystore keystore " +" -storepass password123 -keypass password " +©2013-2022 Tencent Cloud. All rights reserved.

Page 325 of 461

TencentDB for MySQL" -dname CN=MS ";sun.security.tools.keytool.Main.main(importCert.trim().split("\\\\s+"));
sun.security.tools.keytool.Main.main(genKey.trim().split("\\\\s+"));# use the generated keystore and truststore
System.setProperty("javax.net.ssl.keyStore","<path of the downloaded certificate>")System.setProperty("javax.net.ssl.keyStorePassword","tencentdb");
System.setProperty("javax.net.ssl.trustStore","<path of the downloaded certificate>
System.setProperty("javax.net.ssl.trustStorePassword","tencentdb");
url = String.format("jdbc:mysql://%s/%s?serverTimezone=UTC&useSSL=true", '<databaseproperties.setProperty("user", '<database access username>');properties.setProperty("password", '<database access password>');conn = DriverManager.getConnection(url, properties);.NET (MySqlConnector)©2013-2022 Tencent Cloud. All rights reserved.

Page 326 of 461

TencentDB for MySQLvar builder = new MySqlConnectionStringBuilder{
Server = "<database access address>",
UserID = "<database access username>",Password = "<database access password>",
Database = "<the specified database to be accessed>",SslMode = MySqlSslMode.VerifyCA,
SslCa = "<downloaded certificate>",};using (var connection = new MySqlConnection(builder.ConnectionString)){©2013-2022 Tencent Cloud. All rights reserved.

Page 327 of 461

TencentDB for MySQL

connection.Open();}
Python (MySQLConnector Python)try:conn = mysql.connector.connect(user='<database access username>',password='<database access password>',database='<the specified database to be accessed>'
host='<database access address>',
ssl_ca='<path of the downloaded certificate>')except mysql.connector.Error as err:

©2013-2022 Tencent Cloud. All rights reserved.

Page 328 of 461

TencentDB for MySQL

print(err)
Python (PyMySQL)

conn = pymysql.connect(user='<database access username>',password='<database access password>',database='<the specified database to be accessed>',host='<database access address>',
ssl={'ca': '<path of the downloaded certificate>'})Django (PyMySQL)©2013-2022 Tencent Cloud. All rights reserved.

Page 329 of 461

TencentDB for MySQLDATABASES = {'default': {'ENGINE': 'django.db.backends.mysql','NAME': '<the specified database to be accessed>','USER': '<database access username>','PASSWORD': '<database access password>','HOST': '<database access address>','PORT': '<access port>','OPTIONS': {'ssl': {'ca': '<path of the downloaded certificate>'}}©2013-2022 Tencent Cloud. All rights reserved.

Page 330 of 461

TencentDB for MySQL}}
Node.js

var fs = require('fs');
var mysql = require('mysql');
const serverCa = [fs.readFileSync("<path of the downloaded certificate>", "utf8")];var conn=mysql.createConnection({
host:"<database access address>",
user:"<database access username>",password:"<database access password>",©2013-2022 Tencent Cloud. All rights reserved.

Page 331 of 461

TencentDB for MySQL

database:"<the specified database to be accessed>",
port:<access port>,
ssl: {
rejectUnauthorized: true,
ca: serverCa}});
conn.connect(function(err) {if (err) throw err;});
Golang©2013-2022 Tencent Cloud. All rights reserved.

Page 332 of 461

TencentDB for MySQL

rootCertPool := x509.NewCertPool()
pem, _ := ioutil.ReadFile("<path of the downloaded certificate>")if ok := rootCertPool.AppendCertsFromPEM(pem); !ok {log.Fatal("Failed to append PEM.")}
mysql.RegisterTLSConfig("custom", &tls.Config{RootCAs: rootCertPool})var connectionString string
connectionString = fmt.Sprintf("%s:%s@tcp(%s:<access port>)/%s?allowNativePasswords
db, _ := sql.Open("mysql", connectionString)Ruby©2013-2022 Tencent Cloud. All rights reserved.

Page 333 of 461

TencentDB for MySQL

client = Mysql2::Client.new(:host=> '<database access address>',:username => '<database access username>',:password => '<database access password>',:database => '<the specified database to be accessed>',:sslca => '<path of the downloaded certificate>')©2013-2022 Tencent Cloud. All rights reserved.

Page 334 of 461

TencentDB for MySQL

Backup and Rollback
Backing up Databases：

Last updated 2024-07-23 10:05:47
To avoid data loss or corruption, you can back up a database automatically or manually.

Backup Overview
Backup modes
TencentDB for MySQL single-node (cloud disk), two-node (local disk), and three-node (local disk) instances support
automatic backup and manual backup of databases.

Backup types
TencentDB for MySQL two-node and three-node instances support two backup types:
Physical backup: A full copy of physical data (supports both automatic backup and manual backup).
Logical backup: The backup of SQL statements (supports only manual backup).
Note:
To restore a database from a physical backup, you need to use xbstream to decompress the package first. For more
information, see Restoring Database from Physical Backup.
If the number of tables in a single instance exceeds one million, backup may fail and database monitoring may beaffected. Make sure that the number of tables in a single instance is below one million.
As the data of tables created by the MEMORY storage engine is stored in the memory, physical backups cannot becreated for such tables. To avoid data loss, we recommend that you replace them with InnoDB tables.
If there are a high number of tables without a primary key in the instance, backup may fail, and the high availability of
the instance may be affected. You need to create a primary key or secondary index for such tables in time.
Physical Backup Advantages

Logical Backup Disadvantages

High backup speed.
Streaming backup and compression aresupported.
High success rate.
Simple and efficient restoration.
Faster backup-based coupling operations
such as adding real-only instances anddisaster recovery instances.
1/8 of average time needed for creating a
logical backup.

Long time needed to restore as it takes time to run SQL
statements and build indexes.
Low backup speed, especially when there are massive
amounts of data.
Possible increase in source-replica delay due to the pressure
on instances during backup.
Possible loss of precision information of floating points.
Potential backup failures due to wrong views and otherproblems.

©2013-2022 Tencent Cloud. All rights reserved.

Page 335 of 461

TencentDB for MySQL

Ten times faster than logical backups during

Slower backup-based coupling operations such as adding

import.

read-only instances and disaster recovery instances.

TencentDB for MySQL single-node instances of cloud disk edition support snapshot backup:Snapshot
backup backs up data by creating snapshots for disks at the storage layer and is supported for both automatic andmanual backups.
Snapshot Backup Advantages

Snapshot Backup Disadvantages

High backup speed.
Small size.

Cannot be downloaded.

Backup objects
Data Backup

Log Backup

TencentDB for MySQL two-node and three-node instances:
Automatic backup supports full physical backup.

TencentDB for MySQL single-node(cloud disk edition), two-node, andManual backup supports full physical backup, full logical backup, andthree-node instances support binlog

single-database/table logical backup.

backup:Both automatic and manual backups can be compressed anddownloaded.
Single-node instances of cloud disk edition:

Log files occupy the instance's backup
space.
Log files can be downloaded but

Automatic backup supports full snapshot backup.
Manual backup supports full snapshot backup.

cannot be compressed.
Retention periods can be set for log

Both automatic and manual backups cannot be downloaded.

files.

Note
Since February 26, 2019, the automatic backup feature of TencentDB for MySQL only supports physical backup(default type) and no longer provides logical backup. automatically. Existing automatic logical backups will beswitched to physical backups
This will not affect your business access, but may have impact on your habit of automatic backup. If you need logicalbackups, you can use the manual backup option in the TencentDB for MySQL console or call the CreateBackup API
to generate logical backups.
Instance backup files occupy backup space. We recommend that you plan the usage of backup space appropriately.
Usage of backup space that exceeds the free tier will incur fees. For more information, see Backup Space Billing.
We recommend that you back up your database during off-peak hours.
To avoid situations where the required backup files are deleted after the retention period lapses, you need todownload them to the local file system in a timely manner.

©2013-2022 Tencent Cloud. All rights reserved.

Page 336 of 461

TencentDB for MySQLDo not perform DDL operations during the backup process to avoid backup failure due to table locking.
TencentDB for MySQL single-node instances cannot be backed up.

Backing up MySQL Data AutomaticallyConfiguring automatic backup
1. Log in to the TencentDB for MySQL console, click an instance ID on the instance list page to enter the management
page, and select Backup and Restoration > Auto-Backup Settings.

2. Select backup parameters in the pop-up window as detailed below and click OK:
Note:
The rollback feature as described in Rolling back Databases relies on the backup cycle and retention days of data
backups and log backups (binlog). Rollback will be affected if you reduce the automatic backup frequency andretention period. You can select the parameters as needed.
For example, if the backup cycle is set as Monday and Thursday and the retention period is set as seven days, you
can roll a database back to any point of time in the past seven days, which is the actual retention days of data
backups and log backups.
Automatic backups cannot be deleted manually. You can set the retention period for automatic backups, and the
backups will be deleted automatically when they expire.
Increasing the retention period of data and log backups may cause additional backup space fees.
Shortening the retention period of log backups may affect the data rollback cycle of the instance.
In Auto-Backup Settings, you can enable periodic archive for data backups. The settings with periodic archive notenabled are non-archive backup settings. The following describes the parameters for non-archive backup andarchive backup.

Non-archive backup settings©2013-2022 Tencent Cloud. All rights reserved.

Page 337 of 461

TencentDB for MySQLParameter

Description

BackupStart Time

The default backup start time is automatically assigned by the system.
You can set a backup start time range as needed. We recommend that you set it to off-peakhours. This is just the start time of the backup process and does not indicate the end time.
For example, if the backup start time is set to 02:00-06:00 AM, the system will initiate a backup
at a point in time during this period of time, which depends on the backend backup policy andbackup system conditions.

Data
BackupFor TencentDB for MySQL two-node and three-node instances, data backup files can beretained for 7 (default) to 1,830 days and will be automatically deleted upon expiration.

Retention
PeriodFor TencentDB for MySQL single-node instances of cloud disk edition, data backup files can beretained for 7 (default) to 30 days and will be automatically deleted upon expiration.

Backup
Cycle

Configuration rules:
By week: 7 days from Monday to Sunday are selected by default, and you can customize thebackup time; however, to ensure your data security, we recommend that you configure to backup at least twice a week.

©2013-2022 Tencent Cloud. All rights reserved.

Page 338 of 461

TencentDB for MySQL

By month: To protect your data security, the interval between any two adjacent backup dates in amonth cannot exceed 2 days; for example, if you choose to back up on the 1st day of a month,
the next backup date cannot be the 5th day (with the 2nd, 3rd, and 4th days skipped).

Transitionto-Cold
Storage(optional)

Select the target data backup transition-to-cold storage policy and specify the number of days:
Standard storage days: Specify the number of days after which to transition a generated data
backup to standard storage.
Archive storage days: Specify the number of days after which to transition a generated data
backup to archive storage.
For more information on transition-to-cold storage, see Configuring Transition-to-Cold Storage.
Note that the archive storage type isn't available yet.

Log

For TencentDB for MySQL two-node and three-node instances, log backup files can be retained

BackupRetention
Periodfor 7 (default) to 1,830 days and will be automatically deleted upon expiration.
For TencentDB for MySQL single-node instances of cloud disk edition, log backup files can beretained for 7 (default) to 30 days and will be automatically deleted upon expiration.
Select the target binlog backup transition-to-cold storage policy and specify the number of days:

Transitionto-Cold
Storage(optional)

Standard storage days: Specify the number of days after which to transition a generated binlog
backup to standard storage.
Archive storage days: Specify the number of days after which to transition a generated binlog
backup to archive storage.
For more information on transition-to-cold storage, see Configuring Transition-to-Cold Storage.
Note that the archive storage type isn't available yet.

Archive backup settings
Note:
You cannot configure archive backup for single-node instances of cloud disk edition.
Archive backup retention period can only be longer than non-archive backup retention period.

©2013-2022 Tencent Cloud. All rights reserved.

Page 339 of 461

TencentDB for MySQLParameter

Description
The default backup start time is automatically assigned by the system.

BackupStart TimeYou can set a backup start time range as needed. We recommend that you set it to off-peakhours. This is just the start time of the backup process and does not indicate the end time.
For example, if the backup start time is set to 02:00-06:00 AM, the system will initiate a backup
at a point in time during this period of time, which depends on the backend backup policy andbackup system conditions.

Data
BackupFor TencentDB for MySQL two-node and three-node instances, data backup files can beretained for 7 (default) to 1,830 days and will be automatically deleted upon expiration.

Retention
Period©2013-2022 Tencent Cloud. All rights reserved.

Page 340 of 461

TencentDB for MySQL

Configuration rules:

BackupCycle

By week: 7 days from Monday to Sunday are selected by default, and you can customize thebackup time; however, to ensure your data security, we recommend that you configure to backup at least twice a week.
By month: To protect your data security, the interval between any two adjacent backup dates in amonth cannot exceed 2 days; for example, if you choose to back up on the 1st day of a month,
the next backup date cannot be the 5th day (with the 2nd, 3rd, and 4th days skipped).

Archive
Backup

Data backup files can be retained for 90 to 3,650 days (1,080 days by default) and will be

Retention
Periodautomatically deleted upon expiration.

Archive
BackupRetention

You can set the number of backups by month, quarter, or year.

PolicyStart TimeThe time to start archive backup.
Select the target data backup transition-to-cold storage policy and specify the number of days:

Transitionto-Cold
Storage(optional)

Standard storage days: Specify the number of days after which to transition a generated data
backup to standard storage.
Archive storage days: Specify the number of days after which to transition a generated data
backup to archive storage.
For more information on transition-to-cold storage, see Configuring Transition-to-Cold Storage.
Note that the archive storage type isn't available yet.

Log
BackupRetention

Log backup files can be retained for 7 (default) to 1,830 days and will be automatically deleted
upon expiration.

PeriodTransitionto-Cold
Storage(optional)

Select the target binlog backup transition-to-cold storage policy and specify the number of days:
Standard storage days: Specify the number of days after which to transition a generated binlog
backup to standard storage.
Archive storage days: Specify the number of days after which to transition a generated binlog
backup to archive storage.
For more information on transition-to-cold storage, see Configuring Transition-to-Cold Storage.
Note that the archive storage type isn't available yet.

Viewing the retention plan
After you select an archive backup retention policy in the backup settings, you can click View Retention Plan topreview it.

©2013-2022 Tencent Cloud. All rights reserved.

Page 341 of 461

TencentDB for MySQLBlue dates are for non-archive backups.
Red dates are for archive backups.
You can click Non-archive Backup or Archive Backup to hide corresponding dates for easier preview.
The backup plan preview is currently for backups for the year to come and is for reference only.
Example 1: The backup cycle is Monday, Wednesday, Friday, and Sunday, with one backup retained for each monthstarting from January 11, 2022.

©2013-2022 Tencent Cloud. All rights reserved.

Page 342 of 461

TencentDB for MySQLExample 2: The backup cycle is Monday, Wednesday, and Friday, with three backups retained for each quarter
starting from January 11, 2022.

Example 3: Show only archive backups.

©2013-2022 Tencent Cloud. All rights reserved.

Page 343 of 461

TencentDB for MySQL

Backing up MySQL Data Manually
The manual backup feature allows you to initiate a backup task manually.
Note:©2013-2022 Tencent Cloud. All rights reserved.

Page 344 of 461

TencentDB for MySQLFor TencentDB for MySQL two-node and three-node instances, manual backup supports full physical backup, fulllogical backup, and single-database/table logical backup.
For TencentDB for MySQL two-node and three-node instances, manual backups can be manually deleted from the
backup list in the console. You can delete manual backups that are no longer in use to free up space. Manual backups
can be retained as long as they are not deleted until the database instance is deactivated.
For TencentDB for MySQL single-node instances of cloud disk edition, manual backup supports full snapshot backup.
For TencentDB for MySQL single-node instances of cloud disk edition, manual backups cannot be deleted.
When the instance is performing daily automatic backup, no manual backup tasks can be initiated.
Directions for TencentDB for MySQL two-node and three-node instances
1. Log in to the TencentDB for MySQL console, click an instance ID on the instance list page to enter the management
page, and select Backup and Restoration > Manual Backup.
2. Select backup modes and objects in the pop-up window, enter an alias, and click OK.

Note:
For single-database/table logical backup, select the database or table to be backed up in Select databases andtables in the left column and add the selected item to the right column. If you don't have a database, create a
database or table first.

©2013-2022 Tencent Cloud. All rights reserved.

Page 345 of 461

TencentDB for MySQL

Directions for TencentDB for MySQL single-node instances of cloud disk edition
1. Log in to the TencentDB for MySQL console, click the target instance ID on the instance list page to enter the
management page, and select Backup and Restoration > Manual Backup.
2. Enter an alias and click OK.

FAQs
1. Can I download or restore backup files that exceed the retention period?
Expired backup sets will be automatically deleted and cannot be downloaded or restored.
We recommend that you configure a reasonable backup retention period based on your business needs or download
the backup files in the TencentDB for MySQL console. Note that the backup files of single-node instances of cloud
disk edition cannot be downloaded.
You can also manually back up instance data in the console. Manual backups will be retained permanently.
Note:©2013-2022 Tencent Cloud. All rights reserved.

Page 346 of 461

TencentDB for MySQLManual backups will also take up the backup space. We recommend that you plan the usage of the backup spaceappropriately to reduce costs.
2. Can I delete backups manually?
You can't delete automatic backups manually, but you can set the retention period for them so that they are deleted
automatically upon expiration.
For two-node and three-node instances, manual backups can be manually deleted from the backup list in theTencentDB for MySQL console. Manual backups are retained permanently as long as they are not deleted. For singlenode instances of cloud disk edition, manual backups cannot be deleted.
3. Can I disable data and log backups?
No. However, you can reduce the backup frequency and delete unnecessary manual backups in the TencentDB for
MySQL console to lower the space usage. Note that the manual backups of single-node instances of cloud disk
edition cannot be deleted.
4. How do I reduce the backup space costs?
Delete manual backups that are no longer used. You can log in to the TencentDB for MySQL console, click an
instance ID/name to access the instance management page, and delete manual backups on the Backup andRestore tab. Note that the manual backups of single-node instances of cloud disk edition cannot be deleted.
Reduce the frequency of automatic data backup for non-core businesses. You can adjust the backup cycle andretention period in the console, and the frequency should be at least twice a week.
Note:
The rollback feature relies on the backup cycle and retention days of data backups and log backups (binlog). Rollback
will be affected if you reduce the automatic backup frequency and retention period. You can select the parameters asneeded. For more information, see Rolling back Databases.
Shorten the retention period of data and log backups for non-core businesses. A retention period of seven days canmeet the needs in most cases.
Configure the transition-to-cold storage policy to transition backup files and reduce the storage costs. For more
information, see Configuring Transition-to-Cold Storage.
Business Scenario

Recommended Backup Retention Period

Core businesses

7–3,650 days. We recommend that you enable archive backup to periodically retain
backup files in the long term.

Non-core, nondata businesses
Archivebusinesses

7 days7 days. We recommend that you manually back up data based on your actual businessneeds and delete the backups promptly after use.

©2013-2022 Tencent Cloud. All rights reserved.

Page 347 of 461

TencentDB for MySQL

Testingbusinesses

7 days. We recommend that you manually back up data based on your actual businessneeds and delete the backups promptly after use.

©2013-2022 Tencent Cloud. All rights reserved.

Page 348 of 461

TencentDB for MySQL

Configuring Transition-to-Cold Storage：

Last updated 2024-07-23 10:06:41
TencentDB for MySQL supports transition-to-cold storage for backup files to reduce the backup storage costs. This
document describes how to use this feature.
Note:
The free space is not applicable to transitioned backups.
The archive storage type isn't available yet.

Overview
Transition-to-cold storage: The feature automatically transitions the storage types of generated data and binlog
backup files according to the configured transition-to-cold storage rules to reduce the storage costs.
After you configure the backup retention period in Auto-Backup Settings, backup files will be stored according to the
backup policy. Within the configured retention period, you can transition the backup files generated N or X days
(customizable) ago to standard or archive storage respectively through the transition-to-cold storage feature.
Backup file storage types
Standard storage: It is suitable for business scenarios with frequent access and use. It can be used for rollback andcloning, uses no free space, and only supports downloads over the private network.
Archive storage: It is suitable for business scenarios with infrequent access. It has a minimum storage duration of 180
days and does not support downloads.

Feature overview
You can configure to transition backup files generated a certain number of days ago to standard storage. The number
can range from 30 days to the configured number of backup retention days.
You can configure to transition backup files generated a certain number of days ago to archive storage. The number
can range from 180 days to the configured number of backup retention days.
The backup storage type can only be transitioned from hot to cold (general storage > standard storage > archive
storage) but not vice versa.
All the configured transition-to-cold storage policies will be performed at 00:00 (GMT+08:00) on the next day. As
lifecycle tasks are executed asynchronously, the execution for backups after the rule is configured will be finished by
24:00 on the next day in most cases. The time is calculated based on the modification time of the transition-to-cold
storage configuration.
Transition-to-cold storage can be configured for data backups and binlog backups separately.

©2013-2022 Tencent Cloud. All rights reserved.

Page 349 of 461

TencentDB for MySQLTransition-to-cold storage can be used together with periodic archive.

Billing overview
Transitioned backups are stored at lower prices to reduce the storage costs. For billing details, see Backup Space
Billing.

Transition-to-cold storage policy
1. Backup retention period ≤ 30 days: Transition-to-cold storage cannot be configured. To configure it, extend the
backup retention period to more than 30 days.

2. A transition-to-cold storage rule only takes effect after it is selected.

Configuring transition-to-cold storage
1. Log in to the TencentDB for MySQL console, click an instance ID on the instance list page to enter the management
page, and select Backup and Restoration > Auto-Backup Settings.

2. In the Backup Settings pop-up window, configure the data backup retention period and cycle or configure the log
backup retention period, select the target transition-to-cold storage policy, and specify the number of days.

©2013-2022 Tencent Cloud. All rights reserved.

Page 350 of 461

TencentDB for MySQL

3. Read and select Backup Space Billing Notes and click OK.

Examples of transition-to-cold storage
Example 1: Non-archive backup + transition-to-cold storage configurationBackground
Company A has a TencentDB for MySQL instance in Guangzhou region. The data backup retention period is 200days, and the non-archive backup cycle is every Monday, Wednesday, Friday, and Sunday. On December 31, 2022,
the following transition-to-cold storage policy is configured: after a backup file is generated for 90 or 180 days, it will betransitioned to standard or archive storage respectively.
Transition expectations
The transition-to-cold storage policy takes effect on January 1, 2023.

©2013-2022 Tencent Cloud. All rights reserved.

Page 351 of 461

TencentDB for MySQL

Existing backup files: Starting from January 1, 2023, existing backup files generated for more than 90 or 180 days aretransitioned to standard or archive storage respectively.
New backup files: Starting from January 1, 2023, newly generated backup files are transitioned to standard or archive
storage respectively after 90 or 180 days.
Example 2: Archive backup + transition-to-cold storage configurationBackground
Company B has a TencentDB for MySQL instance in Guangzhou region. The data backup retention period is 365
days, the non-archive backup cycle is every Monday, Wednesday, Friday, and Sunday, the archive backup retention
period is 365 days, and one backup file is retained periodically per month. On January 31, 2023, the following
transition-to-cold storage policy is configured: after a backup file is generated for 90 or 180 days, it will be transitioned
to standard or archive storage respectively.
Transition expectations
The transition-to-cold storage policy takes effect on February 1, 2023.
Existing backup files: Starting from February 1, 2023, existing backup files generated for more than 90 or 180 days
are transitioned to standard or archive storage respectively.
New backup files: Starting from February 1, 2023, newly generated backup files are transitioned to standard orarchive storage respectively after 90 or 180 days.
In the backup retention schedule shown in the figure below, each newly generated backup file will be transitioned
according to the time configured in the transition-to-cold storage policy, and backups can be transitioned only from hot
to cold.

©2013-2022 Tencent Cloud. All rights reserved.

Page 352 of 461

TencentDB for MySQL©2013-2022 Tencent Cloud. All rights reserved.

Page 353 of 461

TencentDB for MySQL

Cross-Region Backup：

Last updated 2024-07-23 10:08:14
This document describes the cross-region backup feature of TencentDB for MySQL. This feature allows you to store
backup files in another region, which enhances the regulatory compliance and disaster recovery capabilities andimproves the data reliability.

Background
Data is an important part of enterprise operations. Although the information technology brings convenience, electronic
data and stored information are very vulnerable to damage or loss. Any incident, such as natural disaster, system
failure, maloperation, or virus, can cause business interruptions or even disastrous losses. Therefore, ensuring thesecurity and integrity of core data is a top priority of every enterprise.
The cross-region backup feature of TencentDB for MySQL can be used to store backup files in another region so as tominimize data corruptions caused by natural disasters or system failures. This feature ensures the high availability,
security, and recoverability of data and implement various features, such as remote backup and restoration, remotedisaster recovery, long-term data archive, and regulatory compliance.

Notes on Cross-Region Backup
A cross-region backup can be restored to the instance regions or backup region.

©2013-2022 Tencent Cloud. All rights reserved.

Page 354 of 461

TencentDB for MySQL

Once enabled, cross-region backup doesn't affect the local default backup, and both coexist.
Cross-region backup will be triggered after the local automatic backup is completed, that is, the automatic backup will
be dumped to the storage device for cross-region backup.
The retention period of cross-region backup only affects the backup cycle of the cross-region storage.
Backups and binlogs stored in a remote region cannot use the free storage space, and cross-region backups will use
the space in the backup region of the source instance.
Enabling/disabling cross-region backup or changing the region won't affect existing backups.
After cross-region backup is enabled, the last valid backup and the binlogs generated from the last valid backup timeto the current time will be synced to the target region.
If you enable cross-region backup again, remote backups generated before the enablement cannot be used to restore
data to the specified time point.

Billing
For more information on cross-region backup billing, see Backup Space Billing.

Differences Between Cross-Region Backup and Local Default
BackupComparison
Item
Enabled bydefault

Cross-Region Backup

Local Default Backup

No. It needs to be enabled manually.

Yes.

Up to two specified remote regions.

Instance region.

The data can be restored to:

The data can be restored to:

Original instanceOriginal instanceNew instance in the target region

New instance in the current region

No.

Yes.

BackupstorageregionBackuprestoration
Uses the freestorage space

Supported Regions©2013-2022 Tencent Cloud. All rights reserved.

Page 355 of 461

TencentDB for MySQLThis feature is currently available in Beijing, Shanghai, Guangzhou, Shenzhen, and Chengdu regions and will beavailable in more regions in the future.

Enabling Cross-Region Backup
1. Log in to the TencentDB for MySQL console. In the instance list, click an instance ID or Manage in the Operation
column to enter the instance management page.
2. On the instance management page, select Backup and Restoration > Cross-Region Backup.
3. In the Cross-Region Backup window, complete the configuration and click OK to enable cross-region backup.
Cross-Region Backup: It is disabled by default.
Back up Binlog: When cross-region backup is enabled, it will be enabled automatically and can be disabled
separately.
Backup Region: Select one or two regions other than the source instance region.
Backup Retention Period: 7 days by default. Value range: 3–1830 days. Backup sets will be deleted automaticallyupon expiration.
4. After cross-region backup is completed, the backup will be synced to the target region and can be queried in the
backup list of the source instance.
For cross-region backup files, all selected backup regions are displayed in the Backup Region column.
The backup list has the following fields:
Field
File Name

Description
You can set a filename when creating a backup, which cannot be
modified after the backup is created.

Backup TimeThe backup start time.

Task Start TimeTask End TimeThe time points when the backup task starts and ends respectively.

Backup Size

The size of the current backup file.

Type

The type of the backup file. For a cross-region backup, it is **Physicalcold backup**.

Backup Mode

Automatic backup

Backup Method

Full backup

Backup Region

It displays all regions where the backup file is stored.

StatusIt displays the backup task status.

Operation

DownloadClone©2013-2022 Tencent Cloud. All rights reserved.

Page 356 of 461

TencentDB for MySQLDisabling Cross-Region Backup
You can disable the cross-region backup feature in the console. After it is disabled, cross-region backup files won't bedeleted immediately; instead, they will be deleted automatically upon expiration.
1. Log in to the TencentDB for MySQL console. In the instance list, click an instance ID or Manage in the Operation
column to enter the instance management page.
2. On the instance management page, select Backup and Restoration > Cross-Region Backup.
3. In the Cross-Region Backup window, disable the feature and click OK.

FAQs
Why are fees still incurred after I disable cross-region backup?
If your data volume exceeds the free storage space, the excessive data will be billed. After cross-region backup isdisabled, no more new backups will be generated, but existing backups won't be deleted immediately. They will be
retained within the retention period and use the storage space before expiration, so they will still incur fees before
expiration. You can set the backup retention period to automatically clear all expired backup files, and then no morecross-region backup fees will be incurred.

©2013-2022 Tencent Cloud. All rights reserved.

Page 357 of 461

TencentDB for MySQL

Backup Encryption：

Last updated 2023-09-13 15:48:23
TencentDB for MySQL supports backup encryption for physical backups and log backups (binlog). To use an
encrypted backup, you need to download it and its encryption key for decryption. This document describes how to
enable or disable the backup encryption feature and download a key.

Prerequisite
The MySQL instance architecture is two-node/three-node.

Note
After backup encryption is enabled, the previous backup will not be encrypted, but the new backup files will be
automatically encrypted for storage.
You cannot modify the backup encryption key.
After backup encryption is enabled, you don't need to manually decrypt a backup in the console, as the backend will
decrypt it automatically before relevant operations such as cloning. However, if you download an encrypted backup,
you need to download its key for decryption. For more information, see Restoring Database from Physical Backup.

Enabling backup encryption
1. Log in to the TencentDB for MySQL console. In the instance list, click an instance ID or Manage in the Operation
column to access the instance management page.
2. On the instance management page, select Backup and Restoration and click Backup Encryption.

3. In the pop-up dialog box, select a backup encryption type and click OK.

©2013-2022 Tencent Cloud. All rights reserved.

Page 358 of 461

TencentDB for MySQL

Note
After enabling the corresponding backup encryption, the physical backup time may be extended by 20%, and the log
backup time may be extended by 30%.
4. After the backup encryption is enabled, the backup files generated based on the automatic backup settings will be
automatically encrypted.
5. You can also click Manual backup. On the manual backup setting page, select the configuration, click OK to
encrypt the newly added physical backup.
Parameter

Description

Select backup
mode

Select Physical cold backup.

Object

It is the instance by default.

BackupEncryption

It is enabled by default.

Backup Name

It can contain up to 60 letters, digits, or symbols (-_./()[]+=:@).

Disabling backup encryption
Note
After backup encryption is disabled, the previous backup will not be decrypted, and the new backup files will not be
encrypted for storage.
1. Log in to the TencentDB for MySQL console. In the instance list, click the ID of the target instance or Manage in the
Operation column to enter the instance management page.
2. On the instance management page, select Backup and Restoration and click Backup Encryption.
3. In the pop-up window, disable the corresponding backup encryption type, and click OK.

©2013-2022 Tencent Cloud. All rights reserved.

Page 359 of 461

TencentDB for MySQL

Downloading a backup key
1. Log in to the TencentDB for MySQL console. In the instance list, click the ID of the target instance or Manage in the
Operation column to enter the instance management page.
2. On the instance management page, select the Backup and Restoration > Data Backup List tab, find the target
backup, and click Download Key in the Operation column.

3. In the pop-up window, select the file path where to save the key and click Download.

©2013-2022 Tencent Cloud. All rights reserved.

Page 360 of 461

TencentDB for MySQL

Setting Backup Download Rules：

Last updated 2024-07-23 10:10:25
By default, you can download backup files of TencentDB for MySQL instances over public or private network. To limit
the download, you can adjust backup download settings.
Note:
Backup download settings are supported in the following regions:
Guangzhou, Shanghai, Beijing, Shenzhen, Chengdu, Chongqing, Nanjing, Hong Kong (China), Beijing Finance,
Shanghai Finance, Shenzhen Finance, Toronto, Singapore, Silicon Valley, Frankfurt, Seoul, Mumbai, Bangkok, andTokyo.

Setting backup download rules
1. Log in to the TencentDB for MySQL console, select Database Backup on the left sidebar, and select a region at
the top.
2. On the Download Settings tab, view the backup download settings and click Edit to modify them.
Note:
Download over public network is enabled by default and when it is enabled, download over private network is also
allowed.

3. On the displayed page, set the download rules and click OK.
Download over public network:
Enabled: You cannot set any download rule.
Disabled: You can set the download rules for private network by allowing or blocking specific IPs and VPCs.
Set the download rules:
If you don't specify any value, the condition won't take effect.
You should separate the values of an IP condition with commas.
You can enter IPs or IP ranges as the values of an IP condition.
If no IP and VPC requirements are set, there will be no limit on download over private network.

©2013-2022 Tencent Cloud. All rights reserved.

Page 361 of 461

TencentDB for MySQL

4. After the configuration is completed, return to the Download Settings tab to view the rules that take effect.

Authorizing sub-accounts to set backup download rules
By default, sub-accounts do not have the permission to set backup download rules for TencentDB for MySQL
instances. Therefore, you need to create CAM policies to grant specific sub-accounts the permission.
Cloud Access Management (CAM) is a web-based Tencent Cloud service that helps you securely manage and control
access permissions to your Tencent Cloud resources. Using CAM, you can create, manage, and terminate users(groups), and control the Tencent Cloud resources that can be used by the specified user through identity and policy
management.
You can use CAM to bind a user or user group to a policy which allows or denies them access to specified resources
to complete specified tasks. For more information on CAM policy elements, see Element Reference.

©2013-2022 Tencent Cloud. All rights reserved.

Page 362 of 461

TencentDB for MySQL

Authorizing sub-accounts
1. Log in to the CAM console with the root account, locate the target sub-user in the user list, and click Authorize.

2. In the pop-up window, select the QcloudCDBFullAccess preset policy and click OK to complete the authorization.

Policy syntax
The following policy syntax is used to authorize a sub-account to set backup download rules for TencentDB for
MySQL instances:©2013-2022 Tencent Cloud. All rights reserved.

Page 363 of 461

TencentDB for MySQL{"version":"2.0","statement":[{"effect":"effect","action":["action"],"resource":["resource"]}]}©2013-2022 Tencent Cloud. All rights reserved.

Page 364 of 461

TencentDB for MySQL

version is required. Currently, only the value "2.0" is allowed.
statement element describes the details of one or more permissions. This element contains a permission or
permission set of other elements such as effect , action , and resource . One policy has only one
statement .
effect is required. It describes the result of a statement. The result can be "allow" or an "explicit deny".
action is required. It specifies whether to allow or deny the operation. The operation can be an API (prefixed with
"cdb:"). which can be an API (prefixed with name ) or a feature set (a set of specific APIs prefixed with permid ).
resource is required. It describes the details of authorization.

API operations
In a CAM policy statement, you can specify any API operation from any service that supports CAM. For database
audit, the API prefixed with name/cdb:

should be used. To specify multiple operations in a single statement,

separate them by comma:©2013-2022 Tencent Cloud. All rights reserved.

Page 365 of 461

TencentDB for MySQL"action":["name/cdb:action1","name/cdb:action2"]
You can also specify multiple operations by using a wildcard. For example, you can specify all operations beginningwith "Describe" in the name as shown below:©2013-2022 Tencent Cloud. All rights reserved.

Page 366 of 461

TencentDB for MySQL"action":["name/cdb:Describe*"]Resource path
Resource paths are generally in the following format:©2013-2022 Tencent Cloud. All rights reserved.

Page 367 of 461

TencentDB for MySQL

qcs::service_type::account:resource
service_type: Describes the product abbreviation, such as cdb here.
account: Describes the root account of the resource owner, such as uin/326xxx46 .
resource: Describes the detailed resource information of the specific service. Each TencentDB for MySQL instance(instanceId) is a resource.
Below is a sample:©2013-2022 Tencent Cloud. All rights reserved.

Page 368 of 461

TencentDB for MySQL"resource": ["qcs::cdb::uin/326xxx46:instanceId/cdb-kfxxh3"]
Here, cdb-kfxxh3 is the ID of the TencentDB for MySQL instance resource, i.e., the resource in the CAM
policy statement.

ExampleThe following example only shows the usage of CAM. For the complete list of APIs used to set MySQL backup
download rules, see the API documentation.

©2013-2022 Tencent Cloud. All rights reserved.

Page 369 of 461

TencentDB for MySQL{"version":"2.0","statement":[{"effect":"allow","action": ["name/cdb: ModifyBackupDownloadRestriction"],"resource": ["*"]}]}©2013-2022 Tencent Cloud. All rights reserved.

Page 370 of 461

TencentDB for MySQL

Customizing CAM policy for setting MySQL backup download rules
1. Log in to the CAM console with the root account, select Policies on the left sidebar, and click Create Custom
Policy.

2. In the pop-up dialog box, select Create by Policy Generator.
3. On the Select Service and Action page, select configuration items, click Add Statement, and click Next.
Effect: Select Allow or Deny for the action.
Service: Select TencentDB for MySQL.
Action: Select all APIs of setting MySQL backup download rules. For more information, see the API documentation.
Resource: For more information, see Resource Description Method. You can enter * to indicate that the backup
download rules of TencentDB for MySQL instances in the specified region can be set.

©2013-2022 Tencent Cloud. All rights reserved.

Page 371 of 461

TencentDB for MySQL

4. On the Edit Policy page, enter the Policy Name (such as BackupDownloadRestriction ) as required andDescription and click Done.

5. Return to the policy list and you can view the custom policy just created.

©2013-2022 Tencent Cloud. All rights reserved.

Page 372 of 461

TencentDB for MySQL©2013-2022 Tencent Cloud. All rights reserved.

Page 373 of 461

TencentDB for MySQL

Viewing Backup Space：

Last updated 2024-07-23 10:11:56
This document describes how to view the TencenDB for MySQL instance backup space and free tier in the console.

Overview
For two-node and three-node instances of local disk edition, the backup space occupied by TencentDB for MySQL
instance backup files is allocated by region. It is equivalent to the total storage capacity used by all database backups
in a region, including automatic data backups, manual data backups, and log backups. Increasing the backup
retention period or manual backup frequency will use more database backup space.
For single-node instances of cloud disk edition, the backup space occupied by TencentDB for MySQL instancebackup files is allocated by instance. The free backup space of one instance is equivalent to 200% of its storage
space.

Viewing the backup space and free tier of an instance of local disk
edition
1. Log in to the TencentDB for MySQL console and select Database Backup on the left sidebar.
2. Select a region at the top to view its backup information on the Overview tab, including total backup, backup trend,
and real-time backup statistics.
Total Backup: This section displays the size and quantity of all backups, data backups, and log backups as well as thefree tier occupied by all the backups.
Note:Green: The total backup space used does not exceed the free tier.
Orange: The total backup space used has exceeded the free tier and incurred fees. For more information, see Backup
Space Billing.

©2013-2022 Tencent Cloud. All rights reserved.

Page 374 of 461

TencentDB for MySQL

Backup Trend: This section displays the trends of all backups, data backups, and log backups as well as the freespace.
Real-Time Backup Statistics: This section displays the instance IDs/names (you can click an ID/name to enter the
instance details page), backup space (which can be sorted by size), and data/log backups in the selected region. You
can search for an instance by ID/name in the search box in the top-right corner.
3. Select Backup List at the top, where the backup list is divided into data backups and log backups. Click an
instance name in the list to enter the instance details page. The backup list supports filtering by time period and fuzzy
search by instance ID/name.

Data Backup List
Filtering by information field is supported:
Type: All, logical cold backup, physical cold backup.
Backup Mode: All, Automatic, Manual.
Backup Method: Currently, only full backup is supported.
Backups can be sorted by backup time, task start time, task end time, or backup size.
Click Details in the Operation column to enter the Backup and Restoration tab, where you can click Download todownload backups. You can only delete manual backups
Log Backup List
Backups can be sorted by log data start time or end time.
Click Details in the Operation column to enter the Backup and Restoration tab, where you can click Download todownload logs.

Viewing the backup space and free tier of an instance of cloud disk
edition
1. Log in to the TencentDB for MySQL console. In the instance list, click the ID of the target instance or Manage in the
Operation column to enter the instance management page.

©2013-2022 Tencent Cloud. All rights reserved.

Page 375 of 461

TencentDB for MySQL

2. On the instance management page, select Backup and Restoration to view the used backup space and freespace of the instance.

FAQs
How will I be charged for backup space beyond the free tier? How can I reduce the costs of backup
space?
For more information, see Backup Space Billing.

©2013-2022 Tencent Cloud. All rights reserved.

Page 376 of 461

TencentDB for MySQL

Configuring Local Binlog Retention Policy：

Last updated 2024-07-23 10:12:39
This document describes how to set the binlog retention period for a TencentDB for MySQL instance in the console.
Note:
You cannot configure local binlog retention for single-node instances of cloud disk edition.
If there is a disaster recovery instance for the source instance, the local binlog retention period cannot be shorter than
120 hours.

Binlog Description
Binlog grows fast when a TencentDB for MySQL instance executes large transactions or lots of DML operations.
Binlog is split every 256 MB and uploaded to COS. You can see the uploaded binlog files in the log list in the console.

Overview
Before being uploaded to COS, binlog files are stored on the instance disk (i.e., locally). You can set the local binlog
retention period, control the maximum percentage of disk space binlog can take up, or expand disk space in the
console. We recommend that you clear data no longer used to keep the disk utilization below 80%.
MySQL's data sync is based on binlog. To ensure database restorability, stability, and high availability, binlog cannot
be disabled in TencentDB for MySQL.
The generated binlog files are automatically backed up to COS through the automatic backup feature provided byTencentDB for MySQL. The binlog files whose backups are already uploaded to COS will be cleared according the
local binlog retention policy. To prevent exceptions, the binlog files in use cannot be cleared even they expire.
Therefore, the local binlog clearing has a delay.
Note:©2013-2022 Tencent Cloud. All rights reserved.

Page 377 of 461

TencentDB for MySQL

Rule for clearing expired binlog files:
The local binlog files are checked once every 60 seconds. If a binlog file's start time or space usage does not meet the
set retention rule, it will be added to the queue of to-be-deleted files. The binlog files in the queue will be sorted by timeand deleted starting from the oldest file one by one until the queue is cleared.

Directions
1. Log in to the TencentDB for MySQL console and click an instance ID in the instance list to enter the instancemanagement page.
2. On the instance management page, select the Backup and Restoration and click Configure Local Binlog.
3. In the pop-up window, specify the retention period and space utilization threshold and click OK.

FAQs
Will database restoration be affected if the local binlog retention period is too short?
No, because the generated binlog files will be uploaded to COS through the automatic backup feature as soon as
possible, and those not uploaded yet cannot be cleared. However, too short a retention period will affect the speed ofrollback.
What is the default retention policy for local binlog?
By default, the local binlog retention period is 120 hours, and the maximum binlog space utilization is 30%. You cancustomize the retention period as needed. If there is a disaster recovery instance for the source instance, it cannot beshorter than 120 hours; otherwise, it can range from 72 to 168 hours.

©2013-2022 Tencent Cloud. All rights reserved.

Page 378 of 461

TencentDB for MySQLWill binlog files take up the instance disk space?
Yes. Before the binlog files are uploaded to COS and cleared according to the retention policy, they will be stored on
the instance disk.

©2013-2022 Tencent Cloud. All rights reserved.

Page 379 of 461

TencentDB for MySQL

Restoring Database from Backup File
Restoring Database from Physical Backup：

Last updated 2024-02-18 11:32:00

Overview
Note:
To save the storage space, physical and logical backups in TencentDB for MySQL will be compressed with qpress
and then packed with xbstream offered by Percona.
The open-source Percona XtraBackup can be used to back up and restore databases. This document describes how
to use XtraBackup to restore a physical backup file of TencentDB for MySQL instance to a CVM-based self-built
database.
Note:
If you use the TDE or Instant DDL feature, you cannot restore data from a physical backup in a self-built system.
XtraBackup only supports Linux but not Windows.
For more information about how to restore data in Windows, see Offline Data Migration > Data Migration with
Command Line Tool.

Prerequisites
Download and install XtraBackup.
For MySQL 5.6 and 5.7, download Percona XtraBackup 2.4.6 or later at Percona official website. For more information
on installation, see Percona XtraBackup 2.4 documentation.
For MySQL 8.0, download Percona XtraBackup 8.0.22-15 or later at Percona official website. For more information on
installation, see Percona XtraBackup 8.0 documentation.
Supported instance architectures: two-node or three-node MySQL
Instances with TDE enabled cannot be restored from a physical backup.
Note:This document takes a CVM instance on CentOS and a MySQL 5.7 instance as an example.

Step 1.
Download the backup file

©2013-2022 Tencent Cloud. All rights reserved.

Page 380 of 461

TencentDB for MySQLYou can download data backups and log backups of TencentDB for MySQL instances in the console.
Note:
Each IP can have up to 10 download links by default, with a download speed limit of 20–30 Mbps each.
1. Log in to the TencentDB for MySQL console. In the instance list, click an instance ID or Manage in the Operation
column to enter the instance management page.
2. On the Backup and Restoration > Data Backup List tab, locate the backup file to be downloaded and click
Download in the Operation column.
3. Copy the download address in the pop-up dialog box, log in to the Linux CVM in the same VPC as the TencentDB
instance as instructed in Customizing Linux CVM Configurations, and run wget to download the file over the highspeed private network.
Note:
You can also click Download to download it directly. However, this may take a longer time.
wget command format: wget -c 'backup file download address' -O custom filename.xb
Below is a sample:©2013-2022 Tencent Cloud. All rights reserved.

Page 381 of 461

TencentDB for MySQL

wget -c 'https://mysql-database-backup-sh-1218.cos.ap-nanjing.myqcloud.com/12427%2F

Step 2. Download the backup decryption key (required only if the
backup encryption feature is enabled)
You can download data backups and decryption keys of TencentDB for MySQL instances in the console.
Note:©2013-2022 Tencent Cloud. All rights reserved.

Page 382 of 461

TencentDB for MySQLA decryption key is generated for each database backup separately. If the backup encryption feature is enabled, youneed to download and save the backup file together with the decryption key.
1. Log in to the TencentDB for MySQL console. In the instance list, click an instance ID or Manage in the Operation
column to enter the instance management page.
2. On the Backup and Restoration > Data Backup List tab, locate the decryption key of the backup file to be
downloaded and click Download Key in the Operation column.

Step 3. Restore data
3.1 Unpack the backup fileRun the xbstream command to unpack the backup file to the target directory.

©2013-2022 Tencent Cloud. All rights reserved.

Page 383 of 461

TencentDB for MySQL

xbstream -x --decrypt=AES256 --encrypt-key-file=<backup key file> --parallel=2

-C

Note:
The target directory /data/mysql is used as an example in this document. You can replace it with the directory
you actually use to store the backup file.
Replace /data/test.xb with your backup file.
The unpacking result is as shown below:©2013-2022 Tencent Cloud. All rights reserved.

Page 384 of 461

TencentDB for MySQL

3.2 Decompress the backup file
1. Download qpress by running the following command.

©2013-2022 Tencent Cloud. All rights reserved.

Page 385 of 461

TencentDB for MySQL

wget -d --user-agent="Mozilla/5.0 (Windows NT x.y; rv:10.0) Gecko/20100101 Firefox/
Note:
If an error is displayed during the wget download, you can click here to download qpress locally and upload it to
the Linux CVM instance. For more information, see Uploading Files from Linux or MacOS to Linux CVM via SCP.
2. Extract the qpress binary files by running the following command.

©2013-2022 Tencent Cloud. All rights reserved.

Page 386 of 461

TencentDB for MySQL

tar -xf qpress-11-linux-x64.tar -C /usr/local/binsource /etc/profile
3. Then, decompress all .qp files in the target directory by running the following command:©2013-2022 Tencent Cloud. All rights reserved.

Page 387 of 461

TencentDB for MySQL

xtrabackup --decompress --target-dir=/data/mysql
Note:/data/mysql is the target directory where the backup file was previously stored. You can replace it with thedirectory you actually use.
The --remove-original option is supported only in Percona Xtrabackup 2.4.6 and later.
xtrabackup won't delete the original files during decompression by default. If you want to delete them upon thecompletion of decompression, add the --remove-original parameter to the above command.

©2013-2022 Tencent Cloud. All rights reserved.

Page 388 of 461

TencentDB for MySQL

3.3 Prepare the backup file
After a backup file is decompressed, perform the apply log operation by running the following command.

©2013-2022 Tencent Cloud. All rights reserved.

Page 389 of 461

TencentDB for MySQL

xtrabackup --prepare--target-dir=/data/mysql

If the execution result contains the following output, it means that the prepare operation succeeded.

3.4 Modify the configuration file

©2013-2022 Tencent Cloud. All rights reserved.

Page 390 of 461

TencentDB for MySQL

1. Run the following command to open the backup-my.cnf file.

vi /data/mysql/backup-my.cnf
Note:
The target directory /data/mysql is used as an example in this document. You can replace it with the directory
you actually use.
2. Given the existing version issues, the following parameters need to be commented out from the extracted
backup-my.cnf file.
innodb_checksum_algorithm©2013-2022 Tencent Cloud. All rights reserved.

Page 391 of 461

TencentDB for MySQL

innodb_log_checksum_algorithm
innodb_fast_checksum
innodb_page_size
innodb_log_block_size
redo_log_version

3.5 Modify file attributes
Modify file attributes and check whether files are owned by the mysql user.

©2013-2022 Tencent Cloud. All rights reserved.

Page 392 of 461

TencentDB for MySQL

chown -R mysql:mysql /data/mysql©2013-2022 Tencent Cloud. All rights reserved.

Page 393 of 461

TencentDB for MySQL

Step 4. Start the mysqld process and log in for verification
1. Start the mysqld process.

©2013-2022 Tencent Cloud. All rights reserved.

Page 394 of 461

TencentDB for MySQL

mysqld_safe --defaults-file=/data/mysql/backup-my.cnf --user=mysql --datadir=/data/
2. Log in to the MySQL client for verification.

©2013-2022 Tencent Cloud. All rights reserved.

Page 395 of 461

TencentDB for MySQL

mysql-uroot©2013-2022 Tencent Cloud. All rights reserved.

Page 396 of 461

TencentDB for MySQL

FAQs About Backup
See FAQs and Troubleshooting.

©2013-2022 Tencent Cloud. All rights reserved.

Page 397 of 461

TencentDB for MySQL

Restoring Database from Logical Backup：

Last updated 2024-07-23 10:13:16

Overview
Note:
To save the storage space, physical and logical backups in TencentDB for MySQL will be compressed with qpress
and then packed with xbstream offered by Percona.
TencentDB for MySQL supports logical backup as described in Backing up Databases. In the console, you canmanually create logical backup files of an entire instance or specified databases/tables and download them. This
document describes how to manually restore data from logical backup files.
The restoration method described in this document only applies to Linux.
For more information about how to restore data in Windows, see Offline Data Migration > Data Migration with
Command Line Tool.
Supported instance architectures: two-node or three-node MySQL

Directions
Step 1. Download the backup file
1. Log in to the TencentDB for MySQL console. In the instance list, click an instance ID or Manage in the Operation
column to enter the instance management page.
2. On the Backup and Restoration > Data Backup List tab, locate the backup file to be downloaded and click
Download in the Operation column.
3. We recommend that you copy the download link in the pop-up dialog box, log in to a (Linux) CVM instance in thesame VPC as the TencentDB instance, and run the wget command for download over the private network at ahigher speed. For more information, see Customizing Linux CVM Configurations
Note:
You can also click Download to download it directly. However, this may take a longer time.
wget command format: wget -c 'backup file download address' -O custom filename.xb
Below is a sample:©2013-2022 Tencent Cloud. All rights reserved.

Page 398 of 461

TencentDB for MySQL

wget -c 'https://mysql-database-backup-bj-118.cos.ap-beijing.myqcloud.com/12427%2Fm

Step 2. Unpack the backup file
Unpack the backup file with xbstream.
Note:
xbstream can be downloaded at Percona official website. Select Percona XtraBackup 2.4.6 or later. For more
information on installation, see Installing Percona XtraBackup on Red Hat Enterprise Linux and CentOS.

©2013-2022 Tencent Cloud. All rights reserved.

Page 399 of 461

TencentDB for MySQL

xbstream -x < test0.xb
Note:
Replace test0.xb with your backup file.
The unpacking result is as shown below:©2013-2022 Tencent Cloud. All rights reserved.

Page 400 of 461

TencentDB for MySQL

Step 3. Decompress the backup file
1. Download qpress by running the following command.

©2013-2022 Tencent Cloud. All rights reserved.

Page 401 of 461

TencentDB for MySQL

wget -d --user-agent="Mozilla/5.0 (Windows NT x.y; rv:10.0) Gecko/20100101 Firefox/
Note:
If an error is displayed during the wget download, you can click here to download qpress locally and upload it to
the Linux CVM instance. For more information, see Uploading Files from Linux or MacOS to Linux CVM via SCP.
2. Extract the qpress binary files by running the following command.

©2013-2022 Tencent Cloud. All rights reserved.

Page 402 of 461

TencentDB for MySQL

tar -xf qpress-11-linux-x64.tar -C /usr/local/binsource /etc/profile
3. Decompress the backup file with qpress.

©2013-2022 Tencent Cloud. All rights reserved.

Page 403 of 461

TencentDB for MySQL

qpress -d cdb-jp0zua5k_backup_20191202182218.sql.qp .
Note:Find the backup file with .sql.qp extension by decompression time and replace cdbjp0zua5k_backup_20191202182218 with its filename.
The decompressing result is as shown below:©2013-2022 Tencent Cloud. All rights reserved.

Page 404 of 461

TencentDB for MySQL

Step 4. Import the backup file into the target database
Import the .sql file into the target database by running the following command:©2013-2022 Tencent Cloud. All rights reserved.

Page 405 of 461

TencentDB for MySQL

mysql -uroot -P3306 -h127.0.0.1 -p < cdb-jp0zua5k_backup_20191202182218.sql
Note:This document takes importing into a local MySQL instance with port 3306 as an example. You can replace it asneeded.
Replace cdb-jp0zua5k_backup_20191202182218.sql with the .sql file extracted by qpress.

©2013-2022 Tencent Cloud. All rights reserved.

Page 406 of 461

TencentDB for MySQL

Downloading Backups：

Last updated 2024-07-23 10:13:41
The TencentDB for MySQL console provides the list of backup files that can be downloaded. You can use thedownloaded backups to restore data from one database to another (such as a self-built one).
This document describes how to download a backup file in the console.
Note:
The download rule varies by region. After the cross-region backup feature is enabled, you need to configure thedownload rule for each region selected for backup.
Data backups generated by manual backup for single-node instances of the cloud disk edition are snapshot backups,
which cannot be downloaded.

File types supported for download, decompression, and deletion
Category

Backup Type
Logicalbackup

MethodDownload

Decompression Required After
Download

Deletion

Manual✓✓✓Manual✓✓✓Automatic✓✓×

Automatic

✓

✓

×

Data
backupPhysicalbackupLog
backupPhysicalbackupDownloading a data backup file
1. Log in to the TencentDB for MySQL console.
2. Select the region at the top, find the target instance, and click the instance ID or Manage in the Operation column
to enter the instance management page.
3. On the instance management page, select the Backup and Restoration tab and click Data Backup List.

©2013-2022 Tencent Cloud. All rights reserved.

Page 407 of 461

TencentDB for MySQL

4. Click Download in the Operation column in the backup list to enter the download page. Then, select the backup
file in the target region, click Copy Download URL for high-speed download with the wget command, or directly
click Download.
Note:
We recommend that you copy the download address, log in to a Linux CVM instance in the same VPC as theTencentDB instance as instructed in Customizing Linux CVM Configurations, and run the wget command for fast
download over the private network.
The download address is valid for 12 hours, after which you will need to enter the download page again to get a newone.
The URL must be enclosed with quotation marks when the wget command is used to download.
wget command format: wget -c 'backup file download address' -O custom filename.xb .
5. View the downloaded file.

Downloading a log backup file
1. Log in to the TencentDB for MySQL console.
2. Select the region at the top, find the target instance, and click the instance ID or Manage in the Operation column
to enter the instance management page.
3. On the instance management page, select the Backup and Restoration tab and click Log Backup List.

©2013-2022 Tencent Cloud. All rights reserved.

Page 408 of 461

TencentDB for MySQL

4. Click Download in the Operation column in the backup list to enter the download page. Then, select the backup
file in the target region, click Copy Download URL for high-speed download with the wget command, or directly
click Download.
Note:
We recommend you copy the download address, log in to a Linux CVM instance in the same VPC as the TencentDB
instance as instructed in Customizing Linux CVM Configurations, and run the wget command for fast download
over the private network.
The download address is valid for 12 hours, after which you will need to enter the download page again to get a newone.
The URL must be enclosed with quotation marks when the wget command is used to download.
wget command format: wget -c '<backup file download address>' -O <custom filename> .
5. View the downloaded file.

Decompressing a backup fileFor more information on how to decompress a physical backup file, see Restoring Database from Physical Backup.
For more information on how to decompress a logical backup file, see Restoring Database from Logical Backup.

©2013-2022 Tencent Cloud. All rights reserved.

Page 409 of 461

TencentDB for MySQL

Rolling back Databases：

Last updated 2024-07-23 10:14:39

Overview
TencentDB for MySQL will not modify any of your data. Data corrupted due to personal reasons can be recovered
through rollback in a self-service manner. A rollback feature is provided to roll back databases or tables in Tencent
Cloud based on data backup and binlog backup. Real-time data rollback is supported.
By reconstructing periodical images and real-time transactions, the TencentDB for MySQL rollback feature can rollback a database or table to the specified point in time, and the time slices of all data are guaranteed to be identical. A
new database or table will be generated in the original instance, and during the process, the original database or table
can be accessed normally. Upon the completion of rollback, you can see both the new and original databases ortables.

How Rollback Works
The rollback feature can roll back databases or tables to a specified point in time based on cold data backup
and corresponding binlog backup .

1. Data is exported from the MySQL replica and imported to the cold backup system daily.
2. To roll back databases or tables, request for a temp rollback instance from the rollback system. Export the cold datafrom the cold backup system and import it to the temp rollback instance (types of imported data vary by rollback
method).

©2013-2022 Tencent Cloud. All rights reserved.

Page 410 of 461

TencentDB for MySQL

3. Establish a source-replica relationship between the rollback instance and MySQL source instance, set the rollback
time, and specify the databases or tables to be rolled back.
4. Replicate the rollback databases or tables to the MySQL source instance.

Feature Limits
Single-node instances of the cloud disk edition cannot be rolled back.
Only source instances can be rolled back. Read-only instances and disaster recovery instances cannot be rolled back.
Only specified databases or tables can be rolled back. The databases or tables after rollback will be renamed andreplicated to the source instance.
MySQL 5.6, 5.7, and 8.0 support rollback. If you are using MySQL 5.5, we recommend you upgrade to a later version
as instructed in Upgrading Database Engine.

Note
The rollback feature is subject to the backup cycle and retention days set for automatic backup. It enables datarollback based on data backup and binlog backup according to the configured retention days and backup cycle. For
the backup cycle settings, see Backing up Databases. To ensure MySQL data security, set the automatic backup
cycle to at least twice a week.
If a monthly subscribed instance has not expired but your account has overdue payments, the backup service will be
downgraded with rollback disabled. If you need to roll it back, top up your account to a positive balance.
If the database or table to be rolled back does not exist or has been dropped, you need to log in to the TencentDB
instance and create one first before performing rollback in the console.
If the cold backup before rollback does not contain the table, the rollback will fail.

Directions
1. Log in to the TencentDB for MySQL console, select one or multiple target instances in the instance list, and selectMore > Roll Back.
Note:
If rollback is to be performed on only one instance, you can also go to the instance management page and click Roll
Back in the top-right corner.
Up to 5 rollback tasks can be initiated at a time under the same APPID.

©2013-2022 Tencent Cloud. All rights reserved.

Page 411 of 461

TencentDB for MySQL

2. On the rollback page, select the original database or table and click Next: set the rollback time and databasetable name.
Fast mode: Import full backup of the instance, and then roll back the selected databases and tables. This rollback
mode is slower than the other modes but has no limit.
Faster mode: Full backup + database-level binlog. For cross-database operation, if associated database is notselected at the same time, the database callback will fail.
Ultrafast mode: Full backup + table-level binlog. For cross-table operation, if associated table is not selected at thesame time, the table rollback will fail.
Note:
Only databases/tables with names containing digits, letters, underscores, or their combinations can be rolled back.
Databases/tables with names containing special symbols are not supported.
In the mode where specified databases/tables can be rolled back only, a maximum of 500 databases/tables in thesame instance can be rolled back at a time.
If the rollback involves composite operations on other databases or tables during the execution of binlogs, the SQL
statements may fail.
If the rollback involves foreign keys and other constraints of the table during the execution of binlogs, the SQL
statements may fail.

©2013-2022 Tencent Cloud. All rights reserved.

Page 412 of 461

TencentDB for MySQL

3. Set the post-rollback database or table names and rollback time, and then click Roll Back.
Note:
Only one rollback time can be set for each instance.
If you choose to set a batch rollback time, all databases or tables will be rolled back at the specified time.
If you choose to set a single-table rollback time, tables will be rolled back at their respective rollback time.
The database or table name after rollback can contain up to 64 letters, digits, or symbols (.-_$).

©2013-2022 Tencent Cloud. All rights reserved.

Page 413 of 461

TencentDB for MySQL

4. After submission, go to Operation Log > Rollback Log and view the rollback progress. Click View Details toview the rollback log in real time.

©2013-2022 Tencent Cloud. All rights reserved.

Page 414 of 461

TencentDB for MySQL

5. Once the rollback is completed, go to Database Management > Database List to view the new databases ortables after rollback in the original instance.

©2013-2022 Tencent Cloud. All rights reserved.

Page 415 of 461

TencentDB for MySQL

Deleting Backups：

Last updated 2024-07-23 10:15:00
You can delete database backups to reduce backup space costs.
Note:
Manual backups can be deleted from the backup list in the console, but automatic backups cannot be manually
deleted.

Directions
1. Log in to the TencentDB for MySQL console, click an instance ID in the instance list, and enter the instancemanagement page.
2. On the Backup and Restoration tab, locate the backup you want to delete in the backup list, and click Delete in
the Operation column.

3. In the pop-up dialog box, confirm the backup file to be deleted and click OK.
Note:Once deleted, backup files cannot be recovered.

©2013-2022 Tencent Cloud. All rights reserved.

Page 416 of 461

TencentDB for MySQL

Cloning Instances：

Last updated 2024-02-18 11:22:15
This document describes how to clone a TencentDB for MySQL instance and quickly restore data to the newly
purchased clone in the console.

Overview
TencentDB for MySQL provides the instance cloning feature. You can now restore an instance to any point in timewithin the log backup retention period or from a specific physical backup set by cloning. The clone is a new instancecreated from the backup data according to the restoration point in time you have specified. After the clone has beenverified, you can migrate its data back to the original instance with DTS or you can start using the clone.
Clone mode
Clone an instance and restore the clone to any point in time within the log backup retention period you set.
Clone an instance and restore the clone from a specific physical backup set within the data backup retention period
you set.
Clone billing
The clone adopts the pay-as-you-go billing mode. For more information on this billing mode and fee calculation, see
Billing Overview.
The clone will not be billed until the clone process is completed.

Prerequisites
Supported instance architectures: TencentDB for MySQL single-node, two-node, and three-node architectures.
The original instance must be in Running status.
If the clone mode is set to By backup set, the original instance must have created at least one physical backup. You
can log in to the console and view the backup status on the Backup List tab.
Your account balance must be positive.

Note
The specification of the new instance must be greater than or equal to that of the original instance.

©2013-2022 Tencent Cloud. All rights reserved.

Page 417 of 461

TencentDB for MySQLThe hard disk space of the clone instance must be larger than the amount of the data to be cloned from, or else theclone task may fail.
The AZ, database version, replication mode, and default database parameters of the clone must be the same as thoseof the original instance.
The clone will not be displayed in the instance list in the console until the clone process is completed.

Directions
1. Log in to the TencentDB for MySQL console. In the instance list, click an instance ID or Manage in the Operation
column to enter the instance management page.
2. On the instance management page, select Backup and Restoration > Data Backup List and click Clone in the
top-left corner, or locate the target backup and click Clone in the Operation column.

3. On the displayed purchase page, specify the clone mode and other configuration items and click Buy Now.
By time point: You can restore an instance to any time point within the log backup retention period.
By backup set: You can restore data from a backup set to a new instance. The available backup sets depend on thedata backup retention period.
Note:
You can log in to the console, select Database Backup on the left sidebar, and view backup retention period on the
Backup List tab.

©2013-2022 Tencent Cloud. All rights reserved.

Page 418 of 461

TencentDB for MySQL

4. After successful purchase, you can check the clone details on the Backup and Restoration > Cloned Instance
List tab.

5. After the clone process is completed, you can view the clone in the instance list.

Relevant Documentation
For more information on restoration of a single database or table, see Rolling back Databases.
For more information on how to restore data to a self-created instance, see Restoring Database from Physical Backup
and Restoring Database from Logical Backup.

©2013-2022 Tencent Cloud. All rights reserved.

Page 419 of 461

TencentDB for MySQL

FAQs
Will the access to the source instance be affected during the clone process?
The original backup set and binlogs uploaded to COS are used for cloning, which will not affect the access to thesource instance.

©2013-2022 Tencent Cloud. All rights reserved.

Page 420 of 461

TencentDB for MySQL

Data Migration
Migrating with DTS：

Last updated 2024-07-23 10:15:54
DTS can smoothly migrate structures, full data, and incremental data of MySQL databases in local IDCs, third-party
cloud vendors, and Tencent Cloud to TencentDB for MySQL without causing any server downtime.
Cross-Account TencentDB Instance Migration
Migration from MySQL to TencentDB for MySQL
FAQs about MySQL Data Migration©2013-2022 Tencent Cloud. All rights reserved.

Page 421 of 461

TencentDB for MySQL

Importing SQL Files：

Last updated 2024-06-18 16:37:52

Overview
TencentDB for MySQL supports importing SQL files via the console, allowing you to execute SQL statements in theselected database. You can also use this feature to create databases/tables and change table structures to initialize or
modify the instance.
Note:
Only two-node and three-node TencentDB for MySQL instances support importing SQL files.

Directions
1. Log in to the TencentDB for MySQL console. In the instance list, click an Instance ID or Manage in the Operation
column to access the instance management page.
2. On the instance management page, select Database Management > Database List and click Import Data.

3. In the pop-up window, click Add File to import the file. After the upload is completed, click Next.
Note:
To avoid database unavailability caused by corruption of system tables, do not import data from system tables suchas the mysql.user table.
Only incremental import is supported. Clear any obsolete data in the database before importing.
You can import an unencrypted .zip file. The unzipped files must be .sql files with a total size of no more than 5 GB.
A single file should not exceed 12 GB (if it is zipped, the file should not exceed 5 GB after being unzipped), and the filename can contain only letters, digits, and underscores.
Uploaded files are valid for 14 days and will be automatically deleted after expiration.

©2013-2022 Tencent Cloud. All rights reserved.

Page 422 of 461

TencentDB for MySQL

4. On the Select the target database page, select the target database and click Next.
5. On the confirmation page, confirm that the imported data is correct, enter the account password, and click Import.
Note:
The import cannot be rolled back. Confirm the import information before proceeding.
If you forgot the password, reset it as instructed in Resetting Password.

©2013-2022 Tencent Cloud. All rights reserved.

Page 423 of 461

TencentDB for MySQL©2013-2022 Tencent Cloud. All rights reserved.

Page 424 of 461

TencentDB for MySQL

Migrating Data Offline：

Last updated 2024-07-23 10:17:45
This document describes how to migrate data in the console or with the command line tool.

Data Migration Through Console
There are two modes for migrating data through the console: physical backup and logical backup. For more
information, see the following documents:
Restoring Database from Physical Backup
Restoring Database from Logical Backup

Data Migration with Command Line Tool
1. Generate the SQL file to be imported with the MySQL command line tool "mysqldump" in the following way:Note:
The data files exported using mysqldump must be compatible with the SQL specification of your purchased
TencentDB for MySQL version. You can log in to the database and get the MySQL version information by running theselect version(); command. The name of the generated SQL file can contain letters, digits, and underscores
but not "test".
Make sure that the same source and target database versions, source and target database character sets, andmysqldump tool versions are used. You can specify the character set using the parameter --default-character-set .

©2013-2022 Tencent Cloud. All rights reserved.

Page 425 of 461

TencentDB for MySQL

shell > mysqldump [options] db_name [tbl_name ...] > bak_pathname
Here, options is the export option, db_name is the database name, tbl_name is the table name, andbak_pathname is the export path.
For more information on how to export data with mysqldump, see MySQL official documentation.
2. Import data to the target database with the MySQL command line tool as follows:©2013-2022 Tencent Cloud. All rights reserved.

Page 426 of 461

TencentDB for MySQL

shell > mysql -h hostname -P port -u username -p < bak_pathname
Here, hostname is the target server for data restoration, port is the port of target server, username is theusername of the database on the target server, and bak_pathname is the full path to the backup file.

Migrating data (Windows)
1. Use the Windows version of mysqldump to generate the SQL file to be imported. For more information, see thedescription in Data Migration with Command Line Tool.
2. Enter the command prompt and import the data into the target database with the MySQL command line tool.

©2013-2022 Tencent Cloud. All rights reserved.

Page 427 of 461

TencentDB for MySQL

3. ﻿Log in to the target MySQL database, run the show databases; command, and you can see that the backup
database has been imported into the target database.

Migrating data (Linux)
This document uses a Linux CVM instance as an example. For more information on how to access a database from a
CVM instance, see Accessing MySQL Database.
1. ﻿Log in to the CVM instance and generate the SQL file to be imported with the MySQL command line tool
"mysqldump". Take the db_blog database in TencentDB as an example:©2013-2022 Tencent Cloud. All rights reserved.

Page 428 of 461

TencentDB for MySQL

2. Use the MySQL command line tool to restore the data to the target database.
3. Log in to the target MySQL database, run the show databases; command, and you can see that the backup
database has been imported into the target database.

Issues with Character Set of Imported Data Files
1. If no character set is specified during data file import into TencentDB, the one set by the database will be used.
2. Otherwise, the specified character set will be used.
3. If the specified character set is different from that of TencentDB, garbled text will be displayed.

©2013-2022 Tencent Cloud. All rights reserved.

Page 429 of 461

TencentDB for MySQLFor more information, see the character set description in Use Limits.

©2013-2022 Tencent Cloud. All rights reserved.

Page 430 of 461

TencentDB for MySQL

Monitoring and Alarms
Monitoring：

Last updated 2024-07-23 10:19:28
To make it easier for you to view and stay up to date with how instances work, TencentDB for MySQL provides a wide
variety of performance monitoring metrics and convenient monitoring features (custom view, time comparison, merged
monitoring metrics, etc). You can log in to the TencentDB for MySQL console, and view them in Instance Monitoringon the instance management page.
Note:
You can get instance monitoring metrics by calling the GetMonitorData API or using the TencentDB for MySQL
monitoring metrics in Tencent Cloud Observability Platform (TCOP).
You can create dashboards for monitoring metrics to analyze monitored data dynamically.
If the number of tables in a single instance exceeds one million, database monitoring may be affected. Make sure thatthe number of tables in a single instance is below one million.

Types of Instances for Monitoring
TencentDB for MySQL source, read-only, and disaster recovery instances as well as database proxy nodes can bemonitored, and each instance is provided with a separate monitoring view for easy query.

Monitoring Types
Four types of monitoring are available for TencentDB for MySQL: resource monitoring, engine monitoring (general),engine monitoring (extended), and deployment monitoring. You can view the metrics of different monitoring types togain a quick and accurate understanding of how instances perform and operate.
Note:
TencentDB for MySQL single-node instances of cloud disk edition currently support resource monitoring and engine
monitoring (general) but not engine monitoring (extended) and deployment monitoring.
Resource monitoring provides monitoring data of CPU, memory, disk, and network.
Engine monitoring (general) provides monitoring data of the number of connections, locks, hotspot tables, andslow queries, helping you troubleshoot issues and optimize the performance.
Engine monitoring (extended) provides a wider variety of engine-related monitoring metrics so as to assist you in
identifying existing or potential database problems as much as possible.
Deployment monitoring provides monitoring metrics with regard to source-replica delay. It divides into source
monitoring and replica monitoring:©2013-2022 Tencent Cloud. All rights reserved.

Page 431 of 461

TencentDB for MySQL

If the instance is a source instance, the object of instance deployment monitoring is the linkage between the source
instance and its hidden replica. Deployment monitoring displays the IO and SQL thread status of the hidden replica.
The source-replica delay (in MB or in seconds) refers to the delay between the source instance and its hidden replica.

If the instance is a read-only instance, the object of instance deployment monitoring is the linkage between the source
instance and the read-only instance. Deployment monitoring displays the IO and SQL thread status of the read-only
instance. The source-replica delay (in MB or in seconds) refers to the delay between the read-only instance and thesource instance.
If the instance is a disaster recovery instance:a. The object of instance deployment monitoring (source) is the linkage between the disaster recovery instance andthe source instance. Deployment monitoring displays the IO and SQL thread status of the disaster recovery instance.
The source-replica delay (in MB or in seconds) refers to the delay between the disaster recovery instance and thesource instance.
b. The object of instance deployment monitoring (replica) is the linkage between the disaster recovery instance andits hidden replica. Deployment monitoring displays the IO and SQL thread status of the hidden replica. The sourcereplica delay (in MB or in seconds) refers to the delay between the disaster recovery instance and its hidden replica.

Monitoring Granularity
TencentDB for MySQL has adopted an adaptive policy for monitoring granularity since August 11, 2018, which meansthat you cannot select a monitoring granularity as desired for the time being. The adaptive policy is as follows:Time

Monitoring

Span

Granularity

(0h,
4h]

5 seconds

Adaptation Description
The time span is below 4 hours, and the monitoring granularity is
5 seconds.

©2013-2022 Tencent Cloud. All rights reserved.

Retention
Period1 day

Page 432 of 461

TencentDB for MySQL(4h,

1 minute

2d]
(2d,
10d]
(10d,
30d]

The time span is above 4 hours but below 2 days, and the

15 daysmonitoring granularity is 1 minute.
5 minutes

The time span is above 2 days but below 10 days, and themonitoring granularity is 5 minutes.
The time span is above 10 days but below 30 days, and themonitoring granularity is 1 hour.

1 hour31 days62 days

Note:
Currently, you can view monitoring data of TencentDB for MySQL in the past 30 days.

Monitoring Metrics
TCOP provides the following monitoring metrics for TencentDB for MySQL instances in the instance dimension:Note:
For more information on how to use TencentDB monitoring metrics, see Introduction.
Metric Name

Parameter

Unit

Description
Number of SQL statements

Queries per
SecondTransactions
per Second

Slow
Queries
Full-Table
Scans
SELECT
Queries
UPDATE
Queries

qps

Counts/second(INSERT, SELECT, UPDATE,
DELETE, and REPLACE) executedby the database per second. This
metric mainly represents the actual
processing capability of theTencentDB instance.
The number of transactions

tps

slow_queries

Counts/second-

executed per second in the
database
The number of queries that takemore than long_query_time
second(s) to be executed

select_scan

Counts/sec

select_countCounts/sec

com_update

Counts/sec©2013-2022 Tencent Cloud. All rights reserved.

The number of full-table scans
executed per second
The number of queries executed
per second
The number of updates executed
per second

Page 433 of 461

TencentDB for MySQL

DELETE
Queries

com_delete

Counts/sec

com_insert

Counts/sec

REPLACE
Queriescom_replace

Counts/sec

The number of replacements
executed per second

Total
Queriesqueries

Counts/sec

All executed SQL statements such
as SET and SHOW

threads_connected-

INSERT
QueriesOpen
Connections
Connection
Utilization
Query
Utilization

Total Disk
Usage

The number of deletions executed
per second
The number of insertions executed
per second

The number of currently open
connections

connection_use_rate%

The number of open
connections/the maximum numberof connections

query_rate%

Actual QPS/Recommended QPS

capacityMB

This includes MySQL's data
directories and logs such as binlog,
relaylog, undolog, errorlog, andslowlog.

Disk Space
Used byData

real_capacity

MB

Disk Space
Used by
Logs
Disk Space
Used by Log

This includes only MySQL's logs
log_capacityMB

disk_log_usedMB

disk_tmp_usedMBvolume_rate%

bytes_sent

Byte/sec

Files
Disk Space
Used byTemp Files
Disk
Utilization
PrivateOutboundThis includes only MySQL's data
directories.

©2013-2022 Tencent Cloud. All rights reserved.

binlog, relaylog, undolog, errorlog,
and slowlog.
This includes only MySQL's binlog,
relaylog, and undolog.

This includes only MySQL's temp
files.
Total disk usage/Purchased
instance space
The number of bytes sent per
secondPage 434 of 461

TencentDB for MySQL

Traffic
PrivateInbound
Traffic

bytes_received

Byte/sec

The number of bytes received per
secondqcache_hit_rate%

The query cache hit rateqcache_use_rate%

The query cache utilization

Counts/second

The number of times that a request
for a table lock could not be granted
immediately and a wait was needed

Query
Cache Hit
Rate
Query
Cache
Utilization
Table Locks
Awaited

Temp
Tables
InnoDB
Cache Hit

table_locks_waited

The number of internal temporary
created_tmp_tables

Counts/second

tables created by the server while
executing statements

innodb_cache_hit_rate%

The InnoDB engine cache hit rate

innodb_cache_use_rate%

The InnoDB engine cache utilization

Rate
InnoDB
Cache
Utilization
InnoDB Disk
Reads

InnoDB Disk

The total number of file reads
innodb_os_file_reads

Counts/sec

The total number of file writes
innodb_os_file_writes

Counts/second

innodb_os_fsyncs

Counts/second

Opened by
InnoDB

innodb_num_open_files-

MyISAM
Cache Hit

key_cache_hit_rate%

Writes
InnoDBfsync() Calls

performed by read threads within
InnoDB

Tablesperformed by write threads within
InnoDBThe number of calls of the fsync
function by InnoDB per second
The number of tables InnoDB
currently holds open
The MyISAM engine cache hit rate

Rate

©2013-2022 Tencent Cloud. All rights reserved.

Page 435 of 461

TencentDB for MySQLMyISAM
Cache
Utilization
CPU
Utilization

MemoryUtilization

key_cache_use_rate%

The MyISAM engine cacheutilization
If overuse of idle resources is

cpu_use_rate

memory use rate%%

permitted, the CPU utilization may
exceed 100%
If overuse of idle resources ispermitted, the memory utilization
may exceed 100%
If overuse of idle resources ispermitted, the used memory may
exceed the purchased specification

MemoryUsage

memory_use

MBTemp Files

created_tmp_files

Counts/sec

OpenedTablesopened_tables-

The number of open tables

COMMIT
Statements

com_commit

Counts/sec

The number of COMMIT
statements per second

com_rollback

Counts/sec

CreatedThreads

threads_created-

The number of threads created tohandle connections

Running
Threads

threads_running-

The number of threads that are notsleeping

max_connections-

ROLLBACKStatements

Max
Connections
Temp Disk
Tablescreated_tmp_disk_tables

Counts/sec

Read Next
Row

handler_read_rnd_next

Counts/sec

Rollbacks
Performed inhandler_rollback

Counts/sec

Requests to©2013-2022 Tencent Cloud. All rights reserved.

The number of temp files created
per second

The number of ROLLBACK
statements per second

The maximum number ofconnections
The number of internal on-disk
temporary tables created by theserver while executing statements
The number of requests to read thenext row in the data file
The number of requests for astorage engine to perform a rollback

Page 436 of 461

TencentDB for MySQLStorage

operation

EngineInternal
COMMIT
Statements
InnoDB Free
Pages
Total InnoDB
Pages
InnoDB
LogicalThe number of internal COMMIT
statements per second

handler_commit

Counts/sec

innodb_buffer_pool_pages_free-

innodb_buffer_pool_pages_total-

The total size of the InnoDB buffer
pool in pages

innodb_buffer_pool_read_requests

Counts/sec

The number of logical read requests

The number of free pages in the
InnoDB buffer poolReads
The number of logical reads that
InnoDB could not satisfy from thebuffer pool, and had to read directly

InnoDB
PhysicalReads

innodb_buffer_pool_reads

Data Read in
InnoDB

innodb_data_read

Byte/sec

The amount of data read per
secondTotal InnoDB
Reads

innodb_data_reads

Counts/sec

The total number of data reads per
secondinnodb_data_writes

Counts/sec

innodb_data_written

Byte/sec

The amount of data written persecondinnodb_rows_deleted

Counts/sec

The number of rows deleted from
InnoDB tables

innodb_rows_inserted

Counts/sec

The number of rows inserted into
InnoDB tables

Rows
Updatedinnodb_rows_updated

Counts/sec

InnoDB
Rows Read

innodb_rows_read

Counts/sec

Total InnoDB
WritesData Written
in InnoDB
InnoDB
Rows

Counts/sec

from disk

Deleted
InnoDB
Rows
Inserted
InnoDB©2013-2022 Tencent Cloud. All rights reserved.

The total number of data writes per
secondThe number of rows updated in
InnoDB tables
The number of rows read from
InnoDB tables

Page 437 of 461

TencentDB for MySQL

Avg. Time to
Acquire an
InnoDB Row

innodb_row_lock_time_avg

ms

The average time to acquire a row
lock for InnoDB tables

Lock
InnoDB Row
Lock Waits

The number of times operations on
innodb_row_lock_waits

Counts/sec

key_blocks_unused-

key_blocks_used-

The number of key blocks used by
the MyISAM key cacheCounts/sec

The number of requests to read a
key block from the MyISAM key
cache

UnusedBlocks in
Key Cache
Used Blocks
in KeyCache
Blocks Readfrom Key
Cache
Blocks Readfrom Disk
BlocksWritten into

key_read_requests

by the MyISAM key cache

key_reads

Counts/sec

key_write_requests

Counts/sec

The number of requests to write a
key block to the MyISAM key cacheCounts/sec

The number of requests to write adisk data block to the MyISAM keycache

key_writes

SourceReplica
Delay (inThe number of key blocks unused

The number of requests to read a

Key Cache
BlocksWritten into
Disk

InnoDB tables had to wait for a row
lock

disk data block from the MyISAM
key cache

The amount of data by which themaster_slave_sync_distanceMBseconds_behind_master

Sec

The source-replica delay (inseconds)

slave_io_running

Status values:
0: Yes; 1: No;
2: Connecting

The IO thread running status

MB)

replica has lagged behind thesourceSourceReplica
Delay (inSeconds)
IO Thread
Status©2013-2022 Tencent Cloud. All rights reserved.

Page 438 of 461

TencentDB for MySQLSQL Thread
Statusslave_sql_running©2013-2022 Tencent Cloud. All rights reserved.

Status value:
0: Yes; 1: No

The SQL thread running status

Page 439 of 461

TencentDB for MySQL

Alarm Policies (TCOP)：

Last updated 2024-07-23 10:19:48
This document describes how to create alarm policies and associate alarm objects in the Tencent Cloud Observability
Platform (TCOP) console.

Overview
You can create alarm policies to trigger alarms and send alarm notifications when the Tencent Cloud service statuschanges. The created alarm policies can determine whether an alarm needs to be triggered according to thedifference between the monitoring metric value and the given threshold at intervals.
You can take appropriate precautionary or remedial measures in a timely manner when the alarm is triggered bychanged product status. Therefore, properly created alarm policies can help you improve the robustness and reliabilityof your applications. For more information on alarms, see Creating Alarm Policy in TCOP.
To send an alarm for a specific status of a product, you need to create an alarm policy at first. An alarm policy iscomposed of three compulsory components, that is, the name, type and alarm triggering conditions. Each alarm policy
is a set of alarm triggering conditions with the logical relationship "OR", that is, as long as one of the conditions is met,an alarm will be triggered. The alarm will be sent to all users associated with the alarm policy. Upon receiving thealarm, the user can view the alarm and take appropriate actions in time.
Note:
Make sure that you have set the default alarm recipient; otherwise, no notifications will be sent based on the default
alarm policy of TencentDB.

Directions
Creating an alarm policy
1. Log in to the TCOP console, select Alarm Policy under Alarm Management module on the left sidebar, and click
the Policy Management tab.
2. In the alarm policy list, click Create.
3. On the Create Alarm Policy page, set the policy name, policy type, alarm object, and trigger condition.
Policy Type: It divides into source monitoring and replica monitoring, which are applicable to different types of
instances.
Deploy monitoring on the source: When the monitored instance is a source instance which is not a replica of any
instance, replication-related monitoring data is invalid for the source, and the IO and SQL threads are disabled.

©2013-2022 Tencent Cloud. All rights reserved.

Page 440 of 461

TencentDB for MySQL

Replication-related monitoring data is valid and the IO and SQL threads can be enabled only when the monitored
instance is a disaster recovery or a read-only instance.
Deploy monitoring on the replica: The two-node or three-node source instance and disaster recovery instance come ina source/replica architecture by default. As a result, replication-related monitoring data is valid for the replica only
when the monitored instance is a source or disaster recovery instance. Such monitoring data can reflect the replication
delay distance and time between the source or disaster recovery instance and its hidden replica nodes. We
recommend that you keep an eye out for such monitoring data of the replica. If the source or disaster recovery
instance fails, its monitored hidden replica nodes can be promoted to the source instance quickly.
Alarm Object: The instance to be associated with the policy alarm. You can find the desired instance by selecting theregion where it is located or searching for its ID.
Trigger Condition: An alarm trigger is a semantic condition composed of metric, comparison, threshold, statistical
period, and duration. For example, if the metric is disk utilization, the comparison is >, the threshold is 80%, thestatistical period is 5 minutes, and the duration is two statistical periods, then the data on disk utilization of a database
will be collected once every five minutes, and an alarm will be triggered if the disk utilization exceeds 80% for two
consecutive times.
Configure Alarm Notification: You can select a preset or custom notification template. Each alarm policy can bebound to three notification templates at most. For more information, see Creating Notification Template.

4. After confirming that everything is correct, click Complete.

Associating an alarm object©2013-2022 Tencent Cloud. All rights reserved.

Page 441 of 461

TencentDB for MySQL

After the alarm policy is created, you can associate some alarm objects with it. When an alarm object satisfies analarm trigger condition, an alarm notification will be sent.
1. In the alarm policy list, click the name of an alarm policy to enter the alarm policy management page.
2. Click Add Object in the Alarm Object section.
3. In the pop-up window, select the target alarm object and click OK to associate it with the alarm policy.

FAQs
How can I configure the source-replica delay monitoring?
You can do so by following the steps below based on the actual scenarios.
Scenario 1: Configure source-replica delay monitoring for the source instance
1.1 Log in to the TCOP console select Alarm Policy under Alarm Management module on the left sidebar, and click
Create Policy on the Policy Management tab.
1.2 On the Create Alarm Policy page, select Policy Type: Cloud Database > MySQL > Replica Monitoring.
Note:
When configuring source-replica delay monitoring for the source instance, you must select replica monitoring as thepolicy type, so that the delay information from the replica to the source is monitored.
1.3 Complete the trigger condition settings for the monitoring items "Source-Replica Delay (in MB)" and "SourceReplica Delay (in Seconds)" as well as other configuration items as needed, and click Complete.
1.4 After the setting is completed, the alarm can be triggered when the monitoring items "Source-Replica Delay (inMB)” and "Source-Replica Delay (in Seconds)" meet the trigger conditions.
Scenario 2: Configure source-replica delay monitoring for the read-only and disaster recovery instances
1.1 Log in to the TCOP console select Alarm Policy under Alarm Management module on the left sidebar, and click
Create Policy on the Policy Management tab.
1.2 On the Create Alarm Policy page, select Policy Type: Cloud Database > MySQL > Host Monitoring.
Note:
When configuring source-replica delay monitoring for the read-only instance, you must select host monitoring as thepolicy type, so that the delay information from the read-only instance to the source instance is monitored.
?When configuring source-replica delay monitoring for the disaster recovery instance, you can select host monitoringas the policy type, so that the delay information from the disaster recovery instance to the source instance ismonitored. If you select replica monitoring as the policy type, then the delay information from the replica of the disasterrecovery instance to the disaster recovery instance is monitored.
1.3 Complete the trigger condition settings for the monitoring items "Source-Replica Delay (in MB)" and "SourceReplica Delay (in Seconds)" as well as other configuration items as needed, and click Complete.
1.4 After the setting is completed, the alarm can be triggered when the monitoring items "Source-Replica Delay (inMB)” and "Source-Replica Delay (in Seconds)" meet the trigger conditions.

©2013-2022 Tencent Cloud. All rights reserved.

Page 442 of 461

TencentDB for MySQL

Alarm Notification (DBbrain)：

Last updated 2024-07-23 10:20:22
This document describes how to view exception alarm messages from DBbrain in the TencentDB for MySQL console.
DBbrain's exception alarms notification service pushes MySQL instance exception alarm messages to you in realtime, allowing you to conveniently and promptly discover database exception diagnosis problems.
All pushed exception alarm messages are displayed in the historical message list, so you can quickly view and locate
previously pushed exception diagnosis problems.

Viewing an alarm
Option 1
Log in to the TencentDB for MySQL console. If an exception diagnosis problem occurs on an instance when you are in
the console, a window will pop up in the top-right corner of the console in real time to push the exception alarm
message notification, which contains the database instance information such as instance ID, instance name,diagnosis item, and start time. This allows you to quickly learn the diagnosis of the database instance.
You can click View Exception Diagnosis Details in the message notification to view the specific diagnosis details
and optimization advice for the instance.
If you check No alarm again today in the message notification, when an exception diagnosis problem occurs in a
database instance under your account, no exception alarm messages will be pushed to you in a pop-up window.

Option 2
Log in to the TencentDB for MySQL console, select Instance List, Task List, Parameter Template, Recycle Binor Placement Group on the left sidebar, and click Exception Alarm in the top-right corner to expand the list of
historical exception alarm messages. The number of alarms generated in the instances under your account isdisplayed next to the button.

©2013-2022 Tencent Cloud. All rights reserved.

Page 443 of 461

TencentDB for MySQLIn the expanded list of historical exception alarm messages, you can view all pushed exception alarm messages. You
can view them by region and click a message to view the diagnosis details of the exception alarm event.

©2013-2022 Tencent Cloud. All rights reserved.

Page 444 of 461

TencentDB for MySQL

Setting Event Alarms：

Last updated 2024-06-18 11:11:49
TencentDB for MySQL supports the event alarm feature. When you set an event pattern, event target, and recipient, if
an exception event is detected, the event alarm will send alarm notifications to the recipient through various optional
channels. This document explains how to set up event alarms.

Step 1: Enabling EventBridge
Tencent Cloud EventBridge implements permission management through Cloud Access Management (CAM). CAM isa permission and access management service provided by Tencent Cloud, mainly used to help customers securely
manage access rights to resources under Tencent Cloud accounts. Users can create, manage, and terminate users(groups) with CAM, and control the access rights of other users to Tencent Cloud resources using identity and policy
management. Before using EventBridge, you need to activate the service on the product page. For the method toactivate with a main account and to authorize sub-accounts to use this service, see Activate EventBridge.

Step 2: Setting Event Alarms
Note:
For alarm events generated by TencentDB for MySQL, all will be delivered to the Tencent Cloud service event set,with this delivery being the default and not supporting modification or editing.
After enabling the Tencent Cloud EventBridge service, it will automatically create a default cloud service event set in
the Guangzhou region. Alarm events generated by TencentDB for MySQL will be automatically delivered to it.

Method 1: Tencent Cloud EventBridge Configuration
1. Log in to Tencent Cloud Observability Platform > Event Set.
2. Select Guangzhou as the region at the top.
3. Click on the default event set under the cloud service event set.

4. Click Manage Event Rules, then on the redirection page, click Create (taking creating an event rule as an
example, if an event rule already exists, you can directly modify it with no need to recreate it).
5. After completing the following configuration on the new event rule page, click Next.

©2013-2022 Tencent Cloud. All rights reserved.

Page 445 of 461

TencentDB for MySQLParameter
Rule name

Description
Fill in the rule name, which can only include letters, digits, underscores (_), and hyphens (-), must
start with a letter, end with a digit or letter, and contain 2-60 characters.

Ruledescription

Fill in the rule description, which can only include digits, Chinese and English characters andcommon punctuation marks, and must be no more than 200 characters.

Tag

Customize whether to enable tags. Once enabled, tags can be added to the event rule.

Dataconversion

Event
ExampleRulepattern
Tencent
Cloud

Event data conversion helps you easily process the event content. For example, you can extract
and parse fields within the event, perform mapping reorganization, and then deliver it to the event
target.
Provides an example of event structure for reference in configuring event matching rules. You canfind the target template under event example selection for reference, and select TencentDB for
MySQL as the cloud service type.
Supports form mode and custom events, where form mode is recommended for convenience.

Select TencentDB for MySQL.

service
Event
Type

Select the alarm event type as needed.

Subject tomatch

Select the matching object for event alarms.

6. Complete relevant settings on the event target page, check Enable Event rules now, and click Complete. (There
are various trigger methods available, which you can choose as needed. The following example selects "Message
Push" as the trigger method. The channel push will be sent to the designated contacts. You need to set the recipient
user separately at the recipient area. The notification period shall be agreed upon with the account user. The receiving
channels can include Email, message center, SMS, and Telephone).
Note:
To configure multiple event targets, click Add.

©2013-2022 Tencent Cloud. All rights reserved.

Page 446 of 461

TencentDB for MySQL

7. After an event message push is set, if an event alarm set in the configuration occurs, the system will notify via thereceiving channels set for your specified recipients.

Method 2: TCOP Alarm Policy Configuration
Create an Alarm Policy
1. Log in to the TCOP Console, select Alarm Management > Policy Management page from the left navigation.
2. On the alarm policy list page, click Create Policy.

3. On the policy creation page, complete the settings for basic information, alarm rules, and alarm notifications.
Policy Type: Divided into host monitoring and standby monitoring, with each applicable to different instance types.
Alarm Object: The object instance to be associated can be found by selecting the object's region or searching for theobject's instance ID.
Trigger Condition: Find event alarms, click Add Event, and add alarm events according to business needs.

©2013-2022 Tencent Cloud. All rights reserved.

Page 447 of 461

TencentDB for MySQL

Configure Alarm Notification: Supports selection of system preset notification templates and user-defined
notification templates. Each alarm policy can be bound to a maximum of three notification templates. For user-defined
notification templates, see Create New Notification Template.
Select a system preset template.

Create a template.

©2013-2022 Tencent Cloud. All rights reserved.

Page 448 of 461

TencentDB for MySQL

4. After confirmation, click Complete.
Associate Alarm Objects
After creating an alarm policy, you can also associate it with other alarm objects (other instances that need this alarm
policy). When objects meet the alarm trigger conditions, an alarm will be sent.
1. On the Alarm Policy List Page, click Alarm Policy Name to enter the Manage Alarm Policy page.
2. In the Alarm Object column of the Alarm Policy Management page, click Add Object.
3. In the pop-up dialog box, select the alarm object you wish to associate, and click OK to associate the alarm object.

©2013-2022 Tencent Cloud. All rights reserved.

Page 449 of 461

TencentDB for MySQL

Operation Logs
Operation Logs：

Last updated 2023-11-20 15:45:38

Overview
A SQL statement query that takes more time than the specified value is referred to as a "slow query", and thecorresponding statement is called a "slow query statement". The process where a database administrator (DBA)
analyzes slow query statements and finds out the reasons why slow queries occur is known as "slow query analysis".
In the Operation Log tab, you can view the slow logs details, error logs details, rollback logs, and logs delivery of theinstance and download slow logs. You can also view and download database logs on the command line interface(CLI) or through TencentDB APIs. For more information, see DescribeSlowLogs and DescribeBinlogs.

：

Note

Currently, slow log download, rollback and log delivery features are not supported for TencentDB for MySQL singlenode instances of the cloud disk edition.
Notes on MySQL slow queries
long_query_time: Slow query threshold parameter that is accurate to the microsecond level. The default value is 1
second. When a SQL statement takes more time than the threshold to execute, it will be recorded in a slow log.
When the long_query_time parameter is adjusted, existing slow logs will not be affected. For example, if the slow log
threshold parameter is 1s, slow logs will be reported for exceeding queries; after this value is modified to 2s, thepreviously reported logs will still be displayed.
log_queries_not_using_indexes: Whether to log unindexed queries. The default value is OFF.

The Directions
1. Log in to the TencentDB for MySQL console. In the instance list, click an Instance ID or Manage in the Operation
column to enter the instance management page.
2. On the Operation Log tab, you can view the slow logs details, error logs details, rollback logs and logs delivery of
the instance and download slow logs.
FeatureDescription

Slow Log Details

Records SQL statements that took more than 1 second to execute in the database for the
past month

Download Slow

Downloads slow logs

©2013-2022 Tencent Cloud. All rights reserved.

Page 450 of 461

TencentDB for MySQL

Log
Error Log Details

Records the detailed information of each startup and shutdown as well as all the serious
warnings and errors during operation

Rollback Log

Records the status and progress of rollback tasks

Log Delivery﻿

Collects data from slow logs and error logs sourced from TencentDB for MySQL
instances, and deliver them to the Cloud Log Service (CLS) for analysis

3. On the Download Slow Log tab, click Download in the Operation column to download slow logs.
4. We recommend that you copy the download address in the pop-up window, log in to a (Linux) CVM instance in thesame VPC as the TencentDB instance, and run the wget command to download over the private network at a higher
speed. For more information, see Customizing Linux CVM Configurations.

：

Note

Logs with a size of 0 KB cannot be downloaded.
You can also click Download to download it directly. However, this may take a longer time.
wget command format: wget -c 'log file download address' -O custom filename.log
Below is a sample:©2013-2022 Tencent Cloud. All rights reserved.

Page 451 of 461

TencentDB for MySQL

wget -c 'http://szx.dl.cdb.tencentyun.com:303/cfdee?appid=1210&time=1591&sign=aIGM%©2013-2022 Tencent Cloud. All rights reserved.

Page 452 of 461

TencentDB for MySQL

Log Delivery：

Last updated 2024-06-18 16:23:02
TencentDB for MySQL offers log delivery feature, which can collect slow log and error log details sourced from
TencentDB for MySQL instances and deliver it to Cloud Log Service (CLS) for analysis to quickly monitor andtroubleshoot business issues. This document describes how to enable or disable the log delivery feature in the
console.

Prerequisites
Before using this feature, please ensure that you have enabled CLS.

Use Limits
Only two-node/three-node local disk instances and read-only instances support the use of log delivery.

Slow Log Definition
Field ValueType

Description

TIMESTAMP-

instance_id

StringDatabase instance ID (e.g., cdbxxx).

db_nameStringDatabase name.

rows_examinedLong

Number of scanned rows.

rows_sentLong

Number of returned rows.

query_time

DoubleExecution time (in seconds).

lock_time

DoubleLock wait time (in seconds).

user_host

StringClient information.

Reserved field of CLS, represents©2013-2022 Tencent Cloud. All rights reserved.

the time when the log was
generated.

Page 453 of 461

TencentDB for MySQL

user_name

StringUsername used by the client toconnect to the database instance.

query_sql

StringSlow og SQL.

Type

Description

Error Log Definition
Field ValueReserved field of CLS, represents
TIMESTAMP-

instance_id

Stringcontent

Stringthe time when the log was
generated.
Database instance ID (e.g., cdbxxx).
Content of the error log.
Level of the error log.

level

StringSuch as warning, note and error.
For logs without a level, the entry
would be none, such as deadlock
error logs.

Enabling Slow Log Delivery
1. Log in to the TencentDB for MySQL console. In the instance list, click the Instance ID to enter the management
page.
2. On the instance management page, select Operation Log > Log Delivery.

3. Under Slow Log Delivery, click the Edit icon.
4. In the pop-up window, select Enable, configure the following items, then click OK.

©2013-2022 Tencent Cloud. All rights reserved.

Page 454 of 461

TencentDB for MySQLParameter

Description

RegionSelect the region for log shipping, supporting offsite shipping.

LogsetA logset is a classification of log topics for your convenience in managing them. You canManagement

Select an existing logset or Create a logset.
Select an existing logset: You can filter from the existing logset in the search box toLogsetLog Topic
Management

categorize your slow log delivery.
Create a logset: You can create a new logset to categorize your slow log delivery. The
naming format for creating a logset is cloud_ custom_logset, where the custom field
supports only letters, digits, and underscores, with a length of no more than 20
characters.
A log topic is the fundamental unit for log data collection, storage, search, and analysis.
You can Select an existing log topic or Create a log topic.
Select an existing log topic: This option can be configured only when an existing logset is

Log Topic

Retention Period

selected in logset operations. You may filter the log topics under the selected logset in the
search box.
Create a log topic: Create a new log topic under the selected logset. The naming format
for creating a log topic is cloud_custom_topic, where the custom field only supports
letters, digits, and underscores, with a length of no more than 20 characters.
Note:
You can manage log topic. For more details, see Managing Log Topic.
Select the retention period for the slow log data delivery, which defaults to 30 days. It
allows you to choose between 1 to 3600 days, and the data will be automatically cleared©2013-2022 Tencent Cloud. All rights reserved.

Page 455 of 461

TencentDB for MySQL

after the logs expire. If an existing log topic is selected, the retention time will default tomatch the existing log topic's retention period.

Index Creation

Enabled by default. Index configuration is critical for log retrieval and analysis in CLS.
Only if the index is enabled, the log can be analyzed and retrieved. Learn More.
If an existing log topic is selected, the index status will default to match the existing log
topic's index status.

5. After you successfully enable slow log delivery, you can see the Delivery Status is enable under Slow Log Delivery.
Clicking on the Log Topic Name will take you to the CLS Console for further analysis and management.

Disable Slow Log Delivery
Note:
After disabling the slow log delivery, the generated slow log delivery data will continue to be stored according to theretention period selected when slow log delivery is enabled, and data will be automatically cleared after expiration.
1. Log in to the TencentDB for MySQL console. In the instance list, click the Instance ID to enter the management
page.
2. On the instance management page, select Operation Log > Log Delivery.
3. Under Slow Log Delivery, click the Edit icon.
4. In the pop-up window, select Close and click OK.

Enabling Error Log Delivery
1. Log in to the TencentDB for MySQL console. In the instance list, click the Instance ID to enter the management
page.
2. On the instance management page, select Operation Log > Log Delivery.
3. Under Error Log Delivery, click the Edit icon.
4. In the pop-up window, select Enable, configure the following items, then click OK.

©2013-2022 Tencent Cloud. All rights reserved.

Page 456 of 461

TencentDB for MySQLParameter

Description

RegionSelect the region for log shipping, supporting offsite shipping.

LogsetManagement

A logset is a classification of log topics for your convenience in managing them. You can
Select an existing logset or Create a logset.

LogsetSelect an existing logset: You can filter through existing logsets in the search box tocategorize your error log delivery.
Create a logset: You can create a new logset as the categorization for error log delivery.
The naming format for creating a logset is cloud_custom_logset, where the custom field
supports only letters, digits, and underscores, with a length of no more than 20 characters.

Log Topic
Management

Log Topic

A log topic is the fundamental unit for log data collection, storage, search, and analysis.
You can Select an existing log topic or Create a log topic.
SSelect an existing log topic: This option can be configured only when an existing logset isselected in logset operations. You may filter the log topics under the selected logset in the
search box.
Create a log topic: Create a new log topic under the selected logset. The naming format for
creating a log topic is cloud_custom_topic, where the custom field only supports letters,
digits, and underscores, with a length of no more than 20 characters.
Note:
You can manage log topic. For more details, please refer to Managing Log Topic.
Select the retention period for the slow log data delivery, which defaults to 30 days. It

Retention Period

allows you to choose between 1 to 3600 days, and the data will be automatically cleared
after the logs expire. If an existing log topic is selected, the retention time will default tomatch the existing log topic's retention period.

©2013-2022 Tencent Cloud. All rights reserved.

Page 457 of 461

TencentDB for MySQL

Enabled by default. Index configuration is critical for log retrieval and analysis in CLS. Only
Index Creation

if the index is enabled, the log can be analyzed and retrieved. Learn More.
If an existing log topic is selected, the index status will default to match the existing log
topic's index status.

5. After you successfully enable slow log delivery, you can see the Delivery Status is enable under Error Log Delivery.
Clicking on the Log Topic Name will take you to the CLS Console for further analysis and management.

Disable Error Log Delivery
Note:
After disabling the error log delivery, the generated error log data will continue to be stored according to the retention
period selected when the error log delivery is enabled, and data will be automatically cleared after expiration.
1. Log in to the TencentDB for MySQL console. In the instance list, click the Instance ID to enter the management
page.
2. On the instance management page, select Operation Log > Log Delivery.
3. Under Error Log Delivery, click the Edit icon.
4. In the pop-up window, select Close and click OK.

Related Documents
Logset﻿Managing Log Topic﻿
Chart Overview﻿
Creating Processing Task﻿
Syntax and Rules﻿

©2013-2022 Tencent Cloud. All rights reserved.

Page 458 of 461

TencentDB for MySQL

Tag
Overview：

Last updated 2024-07-23 10:22:09

Overview
A tag is a key-value pair provided by Tencent Cloud to identify a resource in the cloud. For more information, see Tag
Overview.
You can manage TencentDB for MySQL resources in a categorized manner by using various tag types, such as
business, purpose, and person-in-charge, making it easier to find the right resources. Tags have no semantic meaning
for Tencent Cloud and are parsed and matches strictly based on strings. During us, you only need to pay attention toapplicable use limits.
Below is a specific use case to show how a tag is used.

Case BackgroundA company owns 10 TencentDB for MySQL instances in Tencent Cloud. Distributed in three departments(ecommerce, gaming, and entertainment), these instances are used to serve internal business lines such as
marketing, game A, game B, and post-production. The OPS owners of the three departments are John, Jane, andHarry, respectively.

Setting a Tag
To facilitate management, the company categorizes its TencentDB for MySQL resources with tags and defines thefollowing tag key-value pairs.
Tag KeyTag Value

Department

Ecommerce, gaming, and entertainment

Business

Marketing, game A, game B, and post-production

OPS owner

John, Jane, and Harry

These tag keys/values are bound to TencentDB for MySQL instances in the following way:
instance-id

Department

Business

OPS Owner

cdb-abcdef1

Ecommerce

MarketingHarry

cdb-abcdef2

Ecommerce

MarketingHarry

cdb-abcdef3

GamingGame AJohn©2013-2022 Tencent Cloud. All rights reserved.

Page 459 of 461

TencentDB for MySQL

cdb-abcdef3

GamingGame BJohn

cdb-abcdef4

GamingGame BJohn

cdb-abcdef5

GamingGame BJane

cdb-abcdef6

GamingGame BJane

cdb-abcdef7

GamingGame BJane

cdb-abcdef8Entertainment

Post-production

Harry

cdb-abcdef9Entertainment

Post-production

Harry

cdb-abcdef10

Entertainment

Post-production

Harry

Using a Tag
For more information on how to create and delete a tag, see Operation Guide.
For more information on how to edit a tag in TencentDB for MySQL, see Editing a Tag.

©2013-2022 Tencent Cloud. All rights reserved.

Page 460 of 461

TencentDB for MySQL

Editing Tags：

Last updated 2024-07-23 10:22:21
You can edit resource tags by the following steps.

Editing the tag of a single instance
1. Log in to the TencentDB for MySQL console. In the instance list, locate the desired instance and click More > Edit
Tag in the Operation column.
2. In the pop-up dialog box, add, modify, or delete a tag, and click OK.

Editing the tags of multiple instances
1. Log in to the TencentDB for MySQL console. In the instance list, select multiple instances and click More > Edit
Tag at the top.
2. In the pop-up dialog box, add, modify, or delete a tag, and click OK.

©2013-2022 Tencent Cloud. All rights reserved.

Page 461 of 461