Original address: http://blog.chinaunix.net/uid-16844903-id-3896711.htmlBinlog Introduction
- Binlog, the binary log, which records all changes on the database.
- At the end of the SQL statement that changes the database, a record is written at the end of the Binlog, and the statement parser is notified, and the statement executes.
- Binlog format
- Statement-based, there is no guarantee that all statements will succeed from the library, such as update ... limit 1;
- Based on the row, each change is recorded as a row in Binlog. Row-based formatting has an advantage when performing a particularly complex update or delete operation.
Log in to MySQL view Binlog
- View only the contents of the first Binlog file
Show Binlog events;
- View the contents of a specified Binlog file
Show Binlog events in ' mysql-bin.000002 ';
- View the Binlog file that is currently being written
Show Master Status\g
- Get a list of binlog files
Show binary logs;
View with Mysqlbinlog tool
Attention:
- Do not view the Binlog file that is currently being written
- Do not add--force parameters to force access
- If the Binlog format is in line mode, add the-VV parameter
Local view
- Based on start/end time
Mysqlbinlog--start-datetime= ' 2013-09-10 00:00:00 '--stop-datetime= ' 2013-09-10 01:01:01 '-d library name binary file
- Based on POS value
Mysqlbinlog--start-postion=107--stop-position=1000-d Library name binary file
Remote Viewing
- Specify the start/end time and redirect the results to the local T.binlog file.
Mysqlbinlog-u username-p password-hl-db1.dba.beta.cn6.qunar.com-p3306--read-from-remote-server--start-datetime= ' 2013-09-10 23:00:00 '--stop-datetime= ' 2013-09-10 23:30:00 ' mysql-bin.000001 > T.binlog
- Based on POS
Explain the deeper point http://www.linuxidc.com/Linux/2014-09/107095.htm
MySQL Data recovery--binlog http://www.linuxidc.com/Linux/2014-03/97907.htm
MySQL Binlog diary cleanup http://www.linuxidc.com/Linux/2011-02/32017.htm
How to safely remove the Binlog log under MySQL http://www.linuxidc.com/Linux/2013-06/86527.htm
Mysql--binlog Log Recovery Data http://www.linuxidc.com/Linux/2013-04/82368.htm
MySQL Delete binlog log and log recovery data method http://www.linuxidc.com/Linux/2012-12/77072.htm
MySQL Binlog Introduction and analysis of three formats http://www.linuxidc.com/Linux/2012-11/74359.htm
MySQL uses Binlog incremental backup + Restore instance http://www.linuxidc.com/Linux/2012-09/70815.htm
MySQL Delete binlog log and log recovery data http://www.linuxidc.com/Linux/2012-08/67594.htm
How MySQL binlog data is viewed