The default value of the variable expire_logs_days is 10 days, most of the time this is way too long. This mini how-to shows how to change this value. Fortunately expire_logs_days is a dynamic variable so we can edit it while MySQl runs, we don’t need to restart the server.
As we can see the current Master_Log_File is mysql-bin.000029, so we have to purge all binaries prior to this one. Then check the master binary logs status
Eventually set the new value for expire_logs_days and don’t forget to edit your my.cnf:
mysql> SET GLOBAL expire_logs_days=5; Query OK, 0 rows affected (0.00 sec)
mysql> SHOW VARIABLES LIKE 'expire_logs_days'; +------------------+-------+ | Variable_name | Value | +------------------+-------+ | expire_logs_days | 5 | +------------------+-------+ 1 row in set (0.00 sec)
Comments