Skip to content

Flush all MySQL log files

Flush all MySQL log files

Answer:

MySQL default has several log files such as the error log, query log, and slow query log.

Sometimes, To perform log rotation, it is necessary to tell MySQL stop writing to these old log files, rename it and start over again.

To do so, you can execute the FLUSH LOG command in the MySQL client.

mysql> FLUSH LOG;

As a result, it will causes the MySQL to rename the current error log file with a suffix of -old and create a new empty log file.

Usually you should no need to do it manually, you should use tool such as logrotate .

Reference: http://dev.mysql.com/doc/refman/5.0/en/flush.html

Share and Enjoy:
  • Print
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google Bookmarks
  • Blogplay
  1. How to bulk rename files in Linux
  2. How to rename database in MySQL
  3. How to rename table in MySQL
  4. Compare binary value in MySQL
  5. How to check the current logrotate status?

Post a Comment

Your email is never published nor shared. Required fields are marked *
*
*