DBAtlas · Database operations atlas

Rotate the binary log

MySQLBinlog & Log

Command

FLUSH BINARY LOGS;

What it does

Closes the current binary log file and switches to a new one.

When to use it

To create a clean binlog starting point before a backup, or to limit file size.

Caution

Frequent rotation produces many small binlog files. The same command works in MariaDB; FLUSH LOGS rotates all logs.

Open in DBAtlas →

Related