Binary Logs

The MySQL binary log contains all statements that update data along with statements that potentially could have updated it. They are used to recover a database, and required if you want to replicate it. However, when the database changes frequently, they build up and can consume a lot of disk space.

Don't just delete the binary log files in /usr/local/mysql/var! Doing so really screws up MySQL!
Automatically purging binary logs
Edit /etc/my.cnf and add/edit a expire_logs_days variable. For example, to purge logs older than 30 days:

expire_logs_days=30

Purge existing binary logs
Look in /usr/local/mysql/var and to check the name of the oldest binary log file you want to keep

/usr/local/mysql/bin/mysql -u root -p
purge master logs to 'mysql-bin.010';

Completely disable binary logging
Edit /etc/my.cnf

#log-bin=mysql-bin
#binlog_format=mixed

Recent Updates

  • 1 year 12 months ago
  • 1 year 12 months ago
  • 2 years 1 day ago
    php 8.x
  • 2 years 3 days ago
    10.6.7
  • 2 years 4 days ago
    Drop Centos 5/6 stuff