5

I use this solution to delete my binlog before I disable the log. After I disabled it, I tested the below commands to remove the remaining files, but without success.(The purpose of deleting is to save space.)

PURGE BINARY LOGS TO 'binlogname';
PURGE BINARY LOGS BEFORE 'datetimestamp';

My question is: Is it safe to remove them manually? (I found those questions question1 and question2 which are similar to mine but the answer is uncertain to me)

N_Z
  • 248
  • 2
  • 13

2 Answers2

7

As I said in my post from Apr 26, 2013 21:57

Please do not just delete them in the OS.

First you run the purge like this

FLUSH BINARY LOGS;
PURGE BINARY LOGS BEFORE NOW();

Then, go disable it.

Once you disable binary logging, the PURGE BINARY LOGS will say nothing.

If you run SHOW BINARY LOGS, you should see

mysql> show binary logs;
ERROR 1381 (HY000): You are not using binary logging
mysql>

I stated the reasons for not doing it while mysqld is running in my old post.

RolandoMySQLDBA
  • 185,223
  • 33
  • 326
  • 536
-1

Just remove binlog.**** files from /var/lib/mysql, with binlog.index files and restart mysql. So it will create binlog.index again and fix

Sarva
  • 1