Slow query of MySQL-delete slow query logs
I. environment
OS: CentOS release 5.8 (64-bit)
DB: MySQL5.5.17
II. operations
Run the rm-f command to delete the slow query log.
III. problems
The slow query log is not automatically generated. (if there is a backup, it is difficult to copy it back)
IV. Solution
Log on to MySQL as an administrator and execute the command flush logs;
If the execution is successful and the slow query log is not generated, run the following command (disable the slow query first and then enable it)
Set global log_slow_queries = off; (disable slow query)
Set global log_slow_queries = ON; (enable slow query again)
Solve the problem. OK!
5. Suggestions
If the slow query log file is too large, you need to recycle the space to use it, or you need to delete the slow query log file for other reasons, we recommend that you do not directly rm the slow query log file, you can leave the log file empty,
Such as:> mysql-slow.log