MYSQL

MariaDB binlog 삭제 안 되는 경우

from-sh 2025. 2. 4. 13:02
728x90

-- purge 명령어로 binlog 삭제 

purge binary logs to 'mysql-bin.000025';

PURGE BINARY LOGS BEFORE '2025-02-01 00:00:00';

 

-- binlog 보관주기 확인
show global variables like 'expire_logs_days';
set global expire_logs_days=3;
flush privileges;

-- 삭제 안 될시 warnings 확인 
MariaDB [(none)]> show warnings\G
*************************** 1. row ***************************
  Level: Note
   Code: 1375
Message: Binary log 'mysql-bin.000001' is not purged because it is the current active binlog
1 row in set (0.000 sec)

-- slave_connections_needed_for_purge 설정 확인 
show global variables like 'slave_connections_needed_for_purge';
set global slave_connections_needed_for_purge=0;

728x90