2 replaced http://dba.stackexchange.com/ with https://dba.stackexchange.com/
source | link

If you want to erase all binary logs older than 30 minutes, do this

mysql> PURGE BINARY LOGS BEFORE NOW() - INTERVAL 30 MINUTE;

If you want to erase all binary logs except the last one, do this

mysql> PURGE BINARY LOGS BEFORE NOW();

If you want to erase all binary logs before midnight, do this

mysql> PURGE BINARY LOGS BEFORE DATE(NOW()) + INTERVAL 0 SECOND;

If you want to erase all binary logs before midnight 3 days ago, do this

mysql> PURGE BINARY LOGS BEFORE DATE(NOW()) + INTERVAL 0 SECOND - INTERVAL 3 DAY;

I have discussed deleting binary logs like this before

Give it a Try !!!

If you want to erase all binary logs older than 30 minutes, do this

mysql> PURGE BINARY LOGS BEFORE NOW() - INTERVAL 30 MINUTE;

If you want to erase all binary logs except the last one, do this

mysql> PURGE BINARY LOGS BEFORE NOW();

If you want to erase all binary logs before midnight, do this

mysql> PURGE BINARY LOGS BEFORE DATE(NOW()) + INTERVAL 0 SECOND;

If you want to erase all binary logs before midnight 3 days ago, do this

mysql> PURGE BINARY LOGS BEFORE DATE(NOW()) + INTERVAL 0 SECOND - INTERVAL 3 DAY;

I have discussed deleting binary logs like this before

Give it a Try !!!

If you want to erase all binary logs older than 30 minutes, do this

mysql> PURGE BINARY LOGS BEFORE NOW() - INTERVAL 30 MINUTE;

If you want to erase all binary logs except the last one, do this

mysql> PURGE BINARY LOGS BEFORE NOW();

If you want to erase all binary logs before midnight, do this

mysql> PURGE BINARY LOGS BEFORE DATE(NOW()) + INTERVAL 0 SECOND;

If you want to erase all binary logs before midnight 3 days ago, do this

mysql> PURGE BINARY LOGS BEFORE DATE(NOW()) + INTERVAL 0 SECOND - INTERVAL 3 DAY;

I have discussed deleting binary logs like this before

Give it a Try !!!

1
source | link

If you want to erase all binary logs older than 30 minutes, do this

mysql> PURGE BINARY LOGS BEFORE NOW() - INTERVAL 30 MINUTE;

If you want to erase all binary logs except the last one, do this

mysql> PURGE BINARY LOGS BEFORE NOW();

If you want to erase all binary logs before midnight, do this

mysql> PURGE BINARY LOGS BEFORE DATE(NOW()) + INTERVAL 0 SECOND;

If you want to erase all binary logs before midnight 3 days ago, do this

mysql> PURGE BINARY LOGS BEFORE DATE(NOW()) + INTERVAL 0 SECOND - INTERVAL 3 DAY;

I have discussed deleting binary logs like this before

Give it a Try !!!