MySQL log file-related configuration

Source: Internet
Author: User

1, log_output= "file | Table | None "

This parameter specifies the output target of the General_log &slow_query_log, which can be a table | File | None of this to a value;

If table is taken, the logs are exported to the Mysql.general_log and Mysql.slow_log tables.

2, general_log= "1 | 0 "

This parameter is used to control whether the General_log is open

3, general_log_file= "Full path of log files"

In the case of General_log=1 and Log_output=file, the general log will be exported to the target file

4, sql_log_off= "on | Off | 1 | 0 "

Controls whether the current session records the general log

5, slow_query_log= "1 | 0 "

This parameter is used to control whether the slow query log is turned on

6, slow_query_log_file= "Full path of log files"

Log_output=file & Slow_query_log=1 In the case of slow query log saved target file

7, long_query_time= "seconds"

To determine if a SQL is a slow query, compare the time of this SQL execution to the value of long_query_time, if it is greater than even a slow query. Note According to official documents

The description of this time refers to the time when the execution begins to the end, and there may be a period of time before execution to wait for the lock, and this wait time does not count.

8, log_slow_admin_statements= "on | Off

Whether the management statement is logged to a slow query, I did a test; initiated create user | drop TABLE | ALTER TABLE is not recorded, and that's what's needed.

Long_query_time's request.

9, log_slow_slave_statements= "on | Off "

This parameter is used to control whether the slow query executed by the slave-side SQL thread is also added to the slow log.

10, log_queries_not_using_indexes= "on | Off

This parameter is used to control whether query statements that do not go through the index are recorded in the slow log.

11, log_throttle_queries_not_using_indexes= "Maximum number of times"

This parameter is related to the log_queries_not_using_indexes parameter, if the log_queries_not_using_indexes is set to on, as long as SQL is not used in the index

Will be recorded in the slow, if a large number of non-indexed SQL is executed, then they will be recorded in the slow, but there are many are similar,

This causes the slow to be unnecessarily enlarged, and we read it in trouble; To solve this problem, log_throttle_queries_not_using_indexes is born, it is used to control

The number of SQL that is recorded in the slow file in a minute that satisfies the log_queries_not_using_indexes condition, and the default is 0, which means there is no limit.

MySQL log file-related configuration

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.