Binlog is the MySQL binary log, and its primary purpose is to recover the database with the maximum possible, because the binary log contains all the updates made after the backup . In addition,MySQL's master-slave replication feature also relies on this implementation.
The Binlog boot only increases MySQL load by 1% , so it does not become a bottleneck.
MySQL will append a binlog in the form of log_event increments after the data operation succeeds.
Binlog configuration enabled, Vim my.cnf
Log_bin =/var/log/mysql-bin.log## Optional Configuration Binlog_format = MIXED #默认statement, recommended mixedexpire_logs_days = 7max_binlog_size = 1 00m
Binlog of three modes:
1 Statement-based statement
SQL statement that records data changes. The general log volume is small, but the statement execution is less reliable.
2 Row Row based
Records the rows of data that were modified. The data details are clear and reliable, but the general log volume is large.
3 Mixed Mode Mixed
The merging of the above two modes.
Binlog View:
Show binary logs #查看binlog列表show Binlog evnets "in ' Log_name '" #查看指定binlog, without specifying the default first show master status #查看当前在写的binlo G
MySQL's Binlog