Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

We're using mysql 5.0.somethin with a binary log and replication. However /var/log/mysql is full of lots of tiny 141 byte sized mysql-bin.NNNNN files. using mysqlbinlog I can see that they are empty of meaningful SQL statements.

It's not really too big of a problem because I have expire-log-days, but it's a bit of an annoyance. Is there anyway to get mysql to group all these files into one, instead of creating lots of little files?

share|improve this question
up vote 3 down vote accepted

Just to add..

New binary logs files are usually a product of "FLUSH LOGS;", which causes MySQL to flush all log data to disk, close the log files and then re-open them. This can be performed manually or of course as a result of a daemon restart.

Like womble says -- either check whether/why MySQL is restarting so often -- or that you don't have any scripted processes that would prompt a log flush.

share|improve this answer

No. MySQL will create a new binlog every time it restarts (not quite sure why, but it is what it is). I'd look into why MySQL is constantly restarting, myself.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.