PDF
binary log configuration1A brief introduction to MySQL binary logContentsbinary log configuration ............................................................................. 1events in binlog ....................................................................................... 2DELETEbinary log configurationenable mysql binlogmy.cnf[mysqld]log-bin=mysql-binserver_id=1server_idmysql> show binary logs;+------------------+-----------+| Log_name | File_size |+------------------+-----------+| mysql-bin.000001 | 154 |+------------------+-----------+1 row in set (0.00 sec)binlog format events in binlog2[mysqld]log-bin=mysql-binserver_id=1binlog_format="ROW"events in binlogView events in binlogshow binlog eventsmysql> show binlog events in 'mysql-bin.000001';+------------------+-----+----------------+-----------+-------------+---------------------------------------+| Log_name | Pos | Event_type | Server_id | End_log_pos | Info |+------------------+-----+----------------+-----------+-------------+---------------------------------------+| mysql-bin.000001 | 4 | Format_desc | 1 | 123 | Server ver: 5.7.30-log, Binlog ver: 4 || mysql-bin.000001 | 123 | Previous_gtids | 1 | 154 | |+------------------+-----+----------------+-----------+-------------+---------------------------------------+2 rows in set (0.00 sec)create database test;use test;create table foo( id int not null primary key, remark varchar(100));insert into foo(id, remark) values(1, 'hello world!');| mysql-bin.000001 | 219 | Query | 1 | 313 | create database test | events in binlog3| mysql-bin.000001 | 313 | Anonymous_Gtid | 1 | 378 | SET @@SESSION.GTID_NEXT= 'ANONYMOUS' || mysql-bin.000001 | 378 | Query | 1 | 520 | use `test`; create table foo(id int not null primary key,remark varchar(100)) || mysql-bin.000001 | 520 | Anonymous_Gtid | 1 | 585 | SET @@SESSION.GTID_NEXT= 'ANONYMOUS' || mysql-bin.000001 | 585 | Query | 1 | 657 | BEGIN || mysql-bin.000001 | 657 | Table_map | 1 | 706 | table_id: 116 (test.foo) || mysql-bin.000001 | 706 | Write_rows | 1 | 760 | table_id: 116 flags: STMT_END_F || mysql-bin.000001 | 760 | Xid | 1 | 791 | COMMIT /* xid=26 */ |+------------------+-----+----------------+-----------+-------------+----------------------------------------------------------------------------------+event typesQueryTable_map events in binlog4

HTML view coming soon.

Download PDF for the full formatted version.