0

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?

Amandasaurus
  • 31,471
  • 65
  • 192
  • 253

2 Answers2

3

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.

Dan Carley
  • 25,617
  • 5
  • 53
  • 70
2

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.

womble
  • 96,255
  • 29
  • 175
  • 230