2

I have a mysql master/master setup with tungsten replicator. My server is reaching out of space, occupied around 30G in 6 hours. I'm not sure how to handle this. Would be great if some one can help me out of this.

Thanks, Swaroop.

5

If you want to erase all binary logs older than 30 minutes, do this

mysql> PURGE BINARY LOGS BEFORE NOW() - INTERVAL 30 MINUTE;

If you want to erase all binary logs except the last one, do this

mysql> PURGE BINARY LOGS BEFORE NOW();

If you want to erase all binary logs before midnight, do this

mysql> PURGE BINARY LOGS BEFORE DATE(NOW()) + INTERVAL 0 SECOND;

If you want to erase all binary logs before midnight 3 days ago, do this

mysql> PURGE BINARY LOGS BEFORE DATE(NOW()) + INTERVAL 0 SECOND - INTERVAL 3 DAY;

I have discussed deleting binary logs like this before

Give it a Try !!!

2

Rotate logs:

  mysql> FLUSH LOGS;

[Re]move the old binary logs, all except the latest it's safe to remove.

  • Can i purge logs which are 30 minutes older? What will be the exact command? – Swaroop Kundeti Jun 11 '14 at 19:39
  • Only if MySQL isn't writing to it. – akuzminsky Jun 11 '14 at 19:51
  • I'm sorry i did not understand – Swaroop Kundeti Jun 11 '14 at 20:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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