I have multiple queries :

Till when does MySQL retain the binary logs ? What is the default setting ? When does it start logging ?

What does the number of the binary log file name suggest for example in mysql-bin.xxxxxx what does xxxxxx signify.

I have oldest file with name mysql-bin.000163 how can check whether this file was the first binary log file ?

mysql-bin.index contains :


1 Answer 1


The number in the mysql-bin.nnnnnn filename is simply a sequence number. This gets updated every time a FLUSH LOGS is initiated, either manually or through predetermined means and is sequential (e.g. normally starts at 00001 and goes up).

The logs will be kept forever unless you specify an expiry. This should be done in your MySQL configuration:


You can also delete the binary logs manually within MySQL by using the command:


See details here http://dev.mysql.com/doc/refman/5.6/en/purge-binary-logs.html

It is possible to delete the files manually (outside of MySQL) but NOT recommended.

See http://dev.mysql.com/doc/refman/5.6/en/binary-log.html for details on the binary logging system.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.