I followed the instructions given here
In short,
Add this line to your /etc/mysql/my.cnf and it'll need to be in the
[mysqld] section.
expire_logs_days = 7
Then log into Mysql (# mysql -u root -p mysql) and run this command to set the variable without
having to restart Mysql.
SET GLOBAL expire_logs_days=7;
Immediately expire the old logs:
PURGE BINARY LOGS BEFORE DATE_SUB( NOW( ), INTERVAL 7 DAY);
No comments:
Post a Comment