MySQL Slow query-delete slow query log

Source: Internet
Author: User

First, the environment

Os:centos Release 5.8 (64-bit)

db:mysql5.5.17

Second, the operation

Delete the slow query log directly from the command rm-f

Third, problems arise

Slow query log is not automatically generated, (if there is a backup, copy back again is not good to make)

Iv. Methods of Solution

Administrator Login mysql execute command flush logs;

If, after execution, the prompt execution succeeds and the slow query log is not actually generated, execute the following command (slow query is turned off and then on)

SET GLOBAL log_slow_queries = off; (Turn slow query off)
SET GLOBAL log_slow_queries = on; (Re-open slow query)

Problem solving, ok!

V. RECOMMENDATIONS

If you encounter a slow query log file is too large, need to reclaim space to take advantage of, or other reasons need to delete slow query log files, we recommend that you do not directly RM slow query log file, you can empty the log file,

such as: >mysql-slow.log


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.