MySQL binary log rotation

If you've run MySQL in a replication environment, or if you've enabled binary logging for transactional integrity, you know that the binary logs can grow rather quickly. The only safe way to delete the logs is to use PURGE MASTER LOGS in MySQL, but if you want MySQL to automatically remove the logs after a certain period of time, add this in your my.cnf:

expire_logs_days = 14

5.11.3. The Binary Log

Printed from: http://rackerhacker.com/2007/09/07/mysql-binary-log-rotation/ .
© Major Hayden 2012.

2 Comments   »

RSS feed for comments on this post

Leave a Reply

 

  • Welcome! I started this blog as a way to give back to all of the other system administrators who have taught me something in the past. Writing these posts brings me a lot of enjoyment and I hope you find the information useful. If you spot something that's incorrect or confusing, please write a comment and let me know. Drop me a line if there's something you want to know more about and I'll do my best to write a post on the topic.
    -- Major Hayden

    Flattr this