MySQL Low Volume Log Rotation

Set log rotation for low volume databases

It is possible in low write databases; such as development or test databases; that log files will not fill up to rotate before the log retention setting. This will break the pipeline. For these databases, please execute the following to rotate the logs every 24 hours.

-- Execute the following SQL statement to turn on the event scheduler.
SET GLOBAL event_scheduler = ON;

--Create a custom event that rotates (flushes) the binary logs every 24 hours
DROP EVENT IF EXISTS rotate_binlog_24_hrs_event;
CREATE EVENT streamkap_rotate_binlog_24_hrs_event 
ON SCHEDULE EVERY 24 hour 
DO FLUSH BINARY LOGS;