Linux Ask!

Linux Ask! is a Q & A web site specific for Linux related questions. Questions are collected, answered and audited by experienced Linux users.

Jul 052011

Auto remove expired binary log in MySQL


If you have enabled the binary log in your MySQL server, you need to be aware that the log will use up the space of your local disk space. Old binary logs are generally not needed and you can auto remove expired entries from the binary log.

To do so, edit the MySQL configurations, e.g. /etc/my.cnf

expire_logs_days        = 60

The above configuration will auto remove entries in the binary old if they are older than 60 days.

Don't forget to restart MySQL to take effect.

# /sbin/service mysqld restart

 Leave a Reply



You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>