After disabling log-bin by skip-log-bin option, I cannot use PURGE command to remove binary logs.

Refer to the documentation

PURGE BINARY LOGS requires the BINLOG_ADMIN privilege. This statement has no effect if the server was not started with the --log-bin option to enable binary logging.

My question is: If I need reenable log-bin in the future, is it safe to delete remaining binary logs with rm binlog.* command now?

  • What is the goal of deleting the files? Save space? Something else?
    – Rick James
    Commented Aug 5, 2022 at 22:33
  • 1
    To save space .
    – shingo
    Commented Aug 6, 2022 at 4:23

1 Answer 1


No, you should not delete them by hand, it isn't safe.

If you can't use PURGE to remove binary logs, consider using binlog_expire_logs_seconds which will remove automatically the binary log files after their expiration period ends.

  • 1
    Both --binlog-expire-logs-seconds=1 --skip-log-bin and --binlog-expire-logs-seconds=1 --disable-log-bin didn't delete any binary logs. With only --binlog-expire-logs-seconds=1 option, mysqld deleted old binary logs but it created a new one too.
    – shingo
    Commented Aug 5, 2022 at 10:12

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.