MySQL purge old binary logs

If mysql-bin.xxxyyy logs are eating up your partition space. This is the right trick for you:

# login to mysql
mysql -u root -p
# create latest log mysql-bin.0000xy
flush logs;
# purge all logs before mysql-bin.0000xy
purge binary logs to 'mysql-bin.0000xy';

Leave a Reply

Your email address will not be published. Required fields are marked *