S
S
Sergey2016-07-01 16:28:16
MySQL
Sergey, 2016-07-01 16:28:16

Target log not found in binlog index. How to remove MySQL binary logs?

Hello.
/var/lib/mysql/ has accumulated a lot of binary logs like mysql-bin.000001 ... mysql-bin.000207 with large sizes. Enabled log rotation in my.cnf expire_logs_days=4 . Restarted mysql, executed the flush logs command; but nothing was removed. But I noticed that the old logs remained until a certain date. The new logs rotate like normal.
I want to delete old logs. I used these commands d9fb39f5af.jpgand as a result nothing was deleted. I dug up an interesting topic about the mysql-bin.index file.
Now it has the following contents:
./mysql-bin.000206
./mysql-bin.000207
Could this mean the reason why the logs are not deleted through the mysql command?
I want to remove mysql-bin.000004 but it is not listed in the mysql-bin.index file. Maybe because of this we get the error Target log not found in binlog index?
Who faced such problem?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
E
Eugene, 2016-07-01
@Nc_Soft

It is done like this (mysql command)
purge binary logs before now();

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question