- 论坛徽章:
- 0
|
SLOW LOG,目前整的挺复杂的,因为版本的不同,写法会不同。所以你先确定你的版本是什么再说。- Control the slow query log as follows:
- *
- Before 5.1.6, the slow query log destination is always a file. To enable the log, start mysqld with the --log-slow-queries[=file_name] option.
- *
- As of MySQL 5.1.6, the destination can be a file or a table, or both. Start mysqld with the --log-slow-queries[=file_name] option to enable the slow query log, and optionally use --log-output to specify the log destination (as described in Section 5.2.1, “Selecting General Query and Slow Query Log Output Destinations”).
- *
- As of MySQL 5.1.12, as an alternative to --log-slow-queries, use --slow_query_log[={0|1}] to specify the initial slow query log state. In this case, the default slow query log file name is used. With no argument or an argument of 1, --slow_query_log enables the log. With an argument of 0, this option disables the log.
- *
- As of MySQL 5.1.29, use --slow_query_log[={0|1}] to enable or disable the slow query log, and optionally --slow_query_log_file=file_name to specify a log file name. The --log-slow-queries option is deprecated.
复制代码 |
|