Skip to main content
  1. Posts/

MySQL binary log rotation

··71 words·1 min·

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