Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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
add comment

2 Answers 2

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
add comment

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
add comment

Your Answer

 
discard

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.