0

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?

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

1 Answer 1

0

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.

2
  • 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
    Aug 5 at 10:12
  • @shingo And with binlog_expire_logs_auto_purge ? mysqld deleted old binary logs but it created a new one too that are with minimal data which possible will be removed after the binary log flush Aug 5 at 10:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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