Move to the next log

You can use the FLUSH LOGS command to close the current binary log and open a new one:

mysql> SHOW BINARY LOGS;+----------------+-----------+| Log_name       | File_size |+----------------+-----------+| server1.000001 |       154 |+----------------+-----------+1 row in set (0.00 sec)mysql> FLUSH LOGS;Query OK, 0 rows affected (0.02 sec)mysql> SHOW BINARY LOGS;+----------------+-----------+| Log_name       | File_size |+----------------+-----------+| server1.000001 |  198      || server1.000002 |  154      |+----------------+-----------+2 rows in set (0.00 sec)

Get MySQL 8 Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.