In mysql 8, what is a recommended and safe way of removing old bin logs other than with "PURGE BINARY LOGS..."

After disabling binary logging on mysql (with skip-log-bin) I have 500GB of unneeded bin logs. I have no immediate plans of reenabling it, but don't want to break anything if I decide to use it in the future. Is it safe to manually remove them (ie., rm binlog.xxxx) and truncate the index file (echo > binlog.index) perhaps? Since bin-log is disabled, the documented and typically recommended purge commands are unavailable.

1 Answer 1


Instead of manually removing the files, you should use purge statement to purge all binlogs which is safe.

show binary logs -- Pick up the last binary log & purge it.

Yes, you can do rm binlog.XX & remove index file also. This is last option used when nothing works.

But before manually removing that please verify that below statement returns empty rows.

show master status;

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.