Overview

Binary logs

Binary logs are essential for online and warm backup and technically we have two kinds of binary logs:

Statement level: These kind of binary logs are able replicate any kind of statement: DML and DDL, furthermore they do not generate a lot of logs even when you update a lot of rows. The downfall is the fact that binary logs are generated after a commit, because of that, the statement level binary logs might not be in the correct order and thus recovery can be a problem if many tables are being involved.

Row level: These kind of binary logs cannot replicate DDL and generate excessive amount of binary logs for big changes.

Because of the pros and cons of each type of binary logs generation, it is recommended to use the DEFAULT one, which is: BOTH. MySQL is able to decide which type of binary log to generate depending on the situation.Binary logs are indexed with index file, kept by the MySQL.

NEVER DELETE BINARY LOG MANUALLY, ALWAYS USE A TOOL TO REMOVE A BINARY LOGS.

You can check the binary log generation by running the following command:

Enable Binary logs

The binary logs are easy to be enabled, just add the:

Restart

After the binary logs are added, restart the mysqld sevice:

Check

From database side, the location and mode of the binary logs can be checked as follows: