Change the binary logs file manually in MySQL
Close the current binary log file and begin a new one manually by issuing a FlUSH LOGS Command.
Suppose we want to take backup of database, we can do it manually before start to change the binary log or we want to do any testing and restore database at point of time we can flush to change the binary logs.
Example of Flush Logs command
mysql> SHOW BINARY LOGS;
+-----------------+-----------+-----------+
| Log_name | File_size | Encrypted |
+-----------------+-----------+-----------+
| RAC1-bin.000001 | 202 | No |
| RAC1-bin.000002 | 156 | No |
+-----------------+-----------+-----------+
2 rows in set (0.00 sec)
mysql> flush logs;
Query OK, 0 rows affected (0.06 sec)
mysql> SHOW BINARY LOGS;
+-----------------+-----------+-----------+
| Log_name | File_size | Encrypted |
+-----------------+-----------+-----------+
| RAC1-bin.000001 | 202 | No |
| RAC1-bin.000002 | 202 | No |
| RAC1-bin.000003 | 156 | No |
+-----------------+-----------+-----------+
3 rows in set (0.01 sec)