An 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, rollback logs of an instance and download slow logs on the operation log page in the console. You can also view and download database logs on the command line interface (CLI) or through TencentDB APIs. For more information, please see Querying Backup Log and Querying Binary Log.
TencentDB for MySQL (excluding the Basic Edition) instances support operation log management.
long_query_timeparameter is adjusted, existing slow logs will not be affected. For example, if the slow log threshold parameter is 10s, slow logs will be reported for exceeding queries; after this value is modified to 1s, the previously reported logs will still be displayed.
|Slow log details||Records SQL statements that took more than 10s to execute in the database in the last month|
|Slow log download||Provides slow logs to download|
|Error log details||Records logs of database execution errors|
|Rollback log||Records the status and progress of rollback tasks|
Method 1. Click Download to download directly.
Logs with a size of 0 KB cannot be downloaded.
wgetcommand for download.
wgetcommand format: wget -c 'log file download address' -O custom filename.log
Below is an example:
wget -c 'http://szx.dl.cdb.tencentyun.com:303/cfdee?appid=1210&time=1591&sign=aIGM%3D' -O test.log