tencent cloud

TencentDB for MySQL

Release Notes and Announcements
Release Notes
Product Announcements
User Tutorial
Product Introduction
Overview
Strengths
Use Cases
Database Architecture
Resource Isolation Policy
Economical Instance
Feature List
Database Instance
High Availability (Multi-AZ)
Regions and AZs
Service Regions and Service Providers
Kernel Features
Overview
Kernel Version Release Notes
Functionality Features
Performance Features
Security Features
Stability Features
TXRocks Engine
LibraDB Engine
Checking and Fixing Kernel Issues
Purchase Guide
Billing Overview
Selection Guide
Purchase Methods
Renewal
Payment Overdue
Refund
Pay-as-You-Go to Monthly Subscription
Instance Adjustment Fee
Backup Space Billing
Database Audit Billing Overview
Commercial Billing and Activity Description for Database Proxy
Description of the Database Proxy Billing Cycle
Viewing Bills
Getting Started
Overview
Creating MySQL Instance
Connecting to MySQL Instance
SQL Insight (Database Audit)
Overview
Viewing Audit Instance List
Enabling Audit Service
Viewing Audit Log
Log Shipping
Configuring Post-Event Alarms
Modifying Audit Rule
Modifying Audit Services
Disabling Audit Service
Audit Rule Template
SQL Audit Rule (Legacy)
Viewing Audit Task
Authorizing Sub-User to Use Database Audit
MySQL Cluster Edition
Introduction to TencentDB for MySQL Cluster Edition
Creating TencentDB for MySQL Cluster Edition Instance
Maintenance Management Instance
Viewing Instance Monitoring
Adjusting Instance Configuration
Operations for Other Features
Migrate or upgrade to TencentDB for MySQL Cluster Edition
Operation Guide
Use Limits
Operation Overview
Instance Management and Maintenance
Instance Upgrade
CPU Elastic Expansion
Read-Only/Disaster Recovery Instances
Database Proxy
Database Management Center (DMC)
Account Management
Parameter Configuration
Backup and Rollback
Data Migration
Network and Security
Monitoring and Alarms
Log Center
Read-Only Analysis Engine
Tag
Practical Tutorial
Using TencentDB for MySQL to Upgrade MySQL 5.7 to MySQL 8.0
Methods and Instructions for Upgrading from MySQL 5.6 to MySQL 5.7
Cybersecurity Classified Protection Practice for Database Audit of TencentDB for MySQL
Building All-Scenario High-Availability Architecture
Usage Specifications of TencentDB for MySQL
Configuring Automatic Application Reconnection
Impact of Modifying MySQL Source Instance Parameters
Limits on Automatic Conversion from MyISAM to InnoDB
Creating VPCs for TencentDB for MySQL
Enhancing Business Load Capacity with TencentDB for MySQL
Setting up 2-Region-3-DC Disaster Recovery Architecture
Improving TencentDB for MySQL Performance with Read/Write Separation
Migrating Data from InnoDB to RocksDB with DTS
Building LAMP Stack for Web Application
Building Drupal Website
Calling MySQL APIs in Python
The primary and secondary instances have inconsistent query data
White Paper
Performance White Paper
Security White Paper
Troubleshooting
Connections
Performance
Instance Data Sync Delay
Failure to Enable Case Insensitivity
Failure to Obtain slow_query_log_file via a Command
API Documentation
History
Introduction
API Category
Instance APIs
Making API Requests
Data Import APIs
Database Proxy APIs
Database Audit APIs
Security APIs
Task APIs
Backup APIs
Account APIs
Rollback APIs
Parameter APIs
Database APIs
Monitoring APIs
Log-related API
Data Types
Error Codes
FAQs
Related to Selection
Billing
Backup
Rollback
Connection and Login
Parameter Modifications
Instance Upgrade
Account Permissions
Performance and Memory
Ops
Data Migration
Features
Console Operations
Logs
Event
Database audit
Instance Switch Impact
API 2.0 to 3.0 Switch Guide
Service Agreement
Service Level Agreement
Terms of Service
Reference
Standards and Certifications
Contact Us
Glossary

Operation Logs

PDF
Focus Mode
Font Size
Last updated: 2026-01-12 17:16:52

Overview

A SQL statement query that takes more time than the specified value is referred to as a "slow query", and the corresponding 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".
You can view the slow log details, error log details, audit logs, SQL analysis, rollback logs, log shipping, scale-out history, and slow log downloads of instances on the operation logs page in the console. You can also view and download database logs in the command-line interface (CLI) or by using the cloud database API. For details, see Querying Slow Query Logs and Querying Binary Logs.
Note:
TencentDB for MySQL single-node (cloud disk) instances and cluster edition instances do not support slow log download, rollback, and log shipping features. Cluster edition instances also do not support viewing the scale-out history.

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, the previously reported logs will still be displayed.
log_queries_not_using_indexes: Whether to log unindexed queries. The default value is OFF.

The Directions

Note:
If the read-only analysis engine is enabled for an instance, slow SQL statements will appear when data is loaded into the read-only analysis engine for the first time because the data is pulled from a read-write instance. Ignore the slow SQL statement information generated under the "txsqlPlugins_analytics_repl" account.
For cluster edition instances, you can select a specific node of an instance to query both slow log details and error log details on the operation log 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 management page.
2. On the instance management page, select the Log Center tab to view the slow log details, error log details, audit logs, SQL analysis, rollback logs, log shipping, scale-out history, and slow log downloads of the instance.
Feature
Description
Slow Log Details
Records SQL statements that took more than 1 second to execute in the database for the past month
Download Slow Log
Downloads slow logs
Error Log Details
Records the detailed information of each startup and shutdown as well as all the serious warnings and errors during operation
Audit log
After enabling database audit, you can record the activities of the corresponding TencentDB for MySQL instance in real time.
SQL analysis
After enabling SQL analysis, you can perform SQL analysis based on database audit logs.
Rollback Log
Records the status and progress of rollback tasks
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
Scale-out History
Records elastic CPU scale-out operations of the instance.
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 the same 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:
wget -c 'http://szx.dl.cdb.tencentyun.com:303/cfdee?appid=1210&time=1591&sign=aIGM%3D' -O test.log

Help and Support

Was this page helpful?

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

Feedback