开发者

how to stop mysqldump from recording as slow queries

Im recording slow queries longer than 2 seconds. That is running fine except, the daily backups also get recorded in slow log because 1) mysqldump calls select * from xyz (big table); and 2) when inserting the backup into a new db (yest开发者_运维百科erday's backup, sundays backup, etc). How to prevent mysqldump from logging slow queries? Is there a temporary way to switch off slow logging when backup is in progress? Please suggest.

Thanks, Vikas


I think that answers it:

To control the slow log at runtime, use the global slow_query_log and slow_query_log_file system variables. Set slow_query_log to 0 (or OFF) to disable the log or to 1 (or ON) to enable it. Set slow_query_log_file to specify the name of the log file. If a log file already is open, it is closed and the new file is opened.

Taken from: http://dev.mysql.com/doc/refman/5.1/en/slow-query-log.html

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜