In MySQL or MariaDB, anytime you make a change to the database, that particular event is logged.
For example, when you create a new table, or update data on an existing table, those events are stored in the binary logs.
Binary log is very helpful in MySQL replication, where the main server will send the data from the binary logs to the remote servers.
You’ll also be dealing with binary log files when you are performing any kind of recovery operations in MySQL.
mysqlbinlog command is used to view the content of the binary log in a readable user friendly format. You’ll also use the mysqlbinlog command to read the content and pipe it to other mysql utilities.