MySQL binlog_expire_logs_seconds not working

13.3k Views Asked by At

I have configured the database using SET GLOBAL binlog_expire_logs_seconds = 259200; query to purge binary logs older then 3 days. Using MySQL 8.0.22. This does not seem to have any effect. bin logs are accumulating under /var/lib/mysq/dbname-bin.000xx files. Executing

PURGE BINARY LOGS BEFORE '2020-.......' 

works, but I would like the DB engine to purge those logs on its own without myself calling it. Otherwise binlogs take most of the disk space. Please suggest.

1

There are 1 best solutions below

2
On BEST ANSWER

I had the same problem (but on Windows 10), I edited my.ini located in c:/xampp/mysql/bin and added the following:

binlog_expire_logs_seconds=60

Does this work for you?