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

Audit Logs and SQL Analysis

PDF
Focus Mode
Font Size
Last updated: 2025-11-28 18:13:27
TencentDB for MySQL provides the database audit capability, which supports recording database access and SQL statement execution. This feature assists enterprises in risk control and enhances data security. In addition, TencentDB for DBbrain provides the SQL analysis capability to help enterprises perform performance analysis or achieve rapid issue location based on audit logs. The SQL Analysis page aggregates SQL template analysis, allowing users to sort SQL templates globally based on their impact on instance performance metrics over a specified period. These features help users understand statistical information, data distribution, and abnormal values, enabling them to better understand their data and make informed decisions.
This document provides descriptions and operations related to the audit logs from the TencentDB for MySQL side. For more information about SQL analysis, including its introduction, usage, and operations on the TencentDB for DBbrain side, see SQL Analysis (MySQL).

Trial Edition and Official Edition Description

The database audit feature of TencentDB for MySQL and the SQL analysis feature of TencentDB for DBbrain currently offer a 30-day free trial. Trial Edition provides limited capabilities, which can be activated on the Audit Log page and SQL Analysis page in the TencentDB for MySQL console. The following table compares the features between Trial Edition and Official Edition.

Audit Logs

Feature
Trial Edition
Official Edition
Downloading audit logs
Not supported
Supported
Complex query
Not supported
Supported
Time trend comparison
Not supported
Supported
Audit type
Only the full audit supported
Full audit and rule-based audit supported
Query time range
12 hours
Retention duration
SQL query condition
Statement and the name of the database and table
Statement, name of the database and table, SQL template ID, access IP address, user, SQL type, and SQL code
Log detail field
Time, client IP address, database name, user account, SQL type, SQL command details, number of returned rows, number of affected rows, and execution time (µs)
Time, risk level, client IP address, database name, table name, user account, SQL type, SQL command details, error code, thread ID, transaction ID, number of scanned rows, number of returned rows, number of affected rows, execution time (µs), CPU time (µs), lock wait time (µs), I/O wait time (ns), transaction duration (µs), policy name, and audit rule

SQL Analysis

For a comparison between Trial Edition and Official Edition of the SQL analysis capability, see SQL Analysis (MySQL).

Free Trial Description

1. If database audit and SQL analysis are not enabled for your TencentDB for MySQL instances, you can try them for free. The free trial period is within 30 days of activation.
2. If database audit is enabled for your TencentDB for MySQL instances but SQL analysis is not enabled, go to the Audit Log page to view the related log records. At this time, the 30-day free trial of audit logs is not available. However, you can click Try for Free on the SQL Analysis page to obtain a 30-day free trial for SQL analysis.
3. There is no case where SQL analysis is enabled but database audit is not enabled, because when the free trial is enabled on the SQL Analysis page, the free trial of database audit is enabled first.
4. If both database audit and SQL analysis are enabled for your TencentDB for MySQL instances, you can directly go to the Audit Log or SQL Analysis page to view related data. At this time, the 30-day free trials for SQL analysis and audit logs are not available.
5. During the free trial period, you can upgrade from Trial Edition to Official Edition at any time. The remaining time of your free trial can be viewed on both the Audit Log and SQL Analysis pages. Upon expiration of the free trial, if you have not upgraded to Official Edition, all data generated during the use of Trial Edition will be cleared permanently and cannot be recovered.
6. If you disable database audit during the free trial period, you cannot apply for a free trial again. Only the Official Edition database audit can be enabled thereafter.

Billing Description

The Trial Edition audit log and Trial Edition SQL analysis capabilities are free of charge.
Fees are charged for the Official Edition database audit capability. For details, see Database Audit Billing Instructions.
The Official Edition SQL analysis feature is currently in open beta and is available for a free trial. Once the beta phase concludes, an official commercial billing plan will be introduced. For specific pricing details, refer to the official announcement when it is released.

Supported Versions and Architectures

The supported database kernel versions include MySQL 5.6 20180122 and later versions, MySQL 5.7 20190429 and later versions, and MySQL 8.0 20210330 and later versions.
The supported instance architectures include two-node, three-node, and Cluster Edition. Read-only instances are also supported for database audit.
TencentDB for MySQL 5.5 instances, TencentDB for MySQL single-node (cloud disk) instances, the read-only analysis engine, and two-node economical instances do not support database audit.

Enabling the Trial Edition Audit Log Feature

Scenario 1: Enabling the Feature on the Audit Log Page

When you enable the Trial Edition audit log on the Audit Log page, the Trial Edition SQL analysis feature will be enabled simultaneously.
1. Log in to the MySQL console. In the instance list, click Instance ID or Manage in the Operation column to go to the instance details page.
2. Choose Log Center > Audit Log.
3. Click Free Trial.

Note:
Note: This page also provides a button for enabling Official Edition. For details about how to enable Official Edition, see Enabling the Audit Service.
4. Wait for the activation of the Trial Edition audit log.
The Trial Edition Audit Log page is shown in the following figure.


Scenario 2: Enabling the Feature on the SQL Analysis Page

When you enable the Trial Edition audit log on the SQL Analysis page, the Trial Edition audit log will be activated first. To use the Trial Edition SQL analysis, click Try for Free on the SQL Analysis page.
1. Log in to the MySQL console. In the instance list, click Instance ID or Manage in the Operation column to go to the instance details page.
2. Choose Log Center > SQL Analysis.
3. Click Free Trial.

Note:
Note: This page also provides a button for enabling Official Edition. For details about how to enable Official Edition, see Enabling the Audit Service.
4. Wait for the activation of the Trial Edition audit log.
5. Once the feature is enabled, you can view relevant information on the Audit Log page.
6. To use the SQL analysis capability, click Use for Free on the SQL Analysis page.


Upgrading the Audit Log Feature to Official Edition

During the trial period, if you need to upgrade the feature to Official Edition, you can use the following three methods:
Method 1: Click Upgrade to the Official Edition at the top of the Audit Log page to go to the page for enabling the audit service.
Method 2: When the trial countdown reaches 7, 3, or 1 day, a pop-up prompt appears on the Audit Log page. Click Upgrade Now to go to the page for enabling the audit service.
Method 3: On the database audit page, find the instance in the trial period that you want to upgrade to Official Edition, then choose More > Enable Formal Audit Service in the Operation column.
For details about the settings on the audit service page, see Enabling the Audit Service.

Help and Support

Was this page helpful?

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

Feedback