Saturday, December 10, 2016

remove old mysql binary logs

The binary logs can use lots of storage space. Following are 2 ways to clean them up, by name and by time. 

To remove all binary logs up to mysql-bin.003456:

mysql> PURGE BINARY LOGS TO 'mysql-bin.003456';

To remove all binary logs by date/time (Before December 8th, 2016 @6:00):

mysql> PURGE BINARY LOGS BEFORE '2016-12-08 00:06:00';

Search for MySQL binary logs, error logs, temporary files:

# lsof -nc mysqld | grep -vE '(.so(..*)?$|.frm|.MY?|.ibd|ib_logfile|ibdata|TCP)'


Abiya Carol said...

This blog is having the general information. Got a creative work and this is very different one.We have to develop our creativity mind.This blog helps for this. Thank you for this blog. This is very interesting and useful.

Aws Training in Chennai

Shalini said...

Great site for these post and i am seeing the most of contents have useful for my Carrier.Thanks to such a useful information.Any information are commands like to share him.

Seo Company in Chennai