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?

shingo
  • 101
  • 2

1 Answers1

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.

Ergest Basha
  • 3,935
  • 3
  • 6
  • 20
  • 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 Aug 05 '22 at 10:12