MySQL corresponding Binlog view

Source: Internet
Author: User

What is Binlog
  1. Binlog, the binary log, which records all changes on the database.
  2. 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.
  3. 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.
How to view Binlog

1. View only the contents of the first Binlog file

Show Binlog events;

2. View the contents of the specified Binlog file

Show Binlog events in ' mysql-bin.000002 ';

3. View the Binlog file that is currently being written

Show Master Status\g

4. Get a list of binlog files

Show binary logs;
View Binlog Locally

1. 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

2. Based on POS value

Mysqlbinlog--start-postion=107--stop-position=1000-d Library name binary file
View Binlog remotely

Specify the start/end time and redirect the results to a 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

MySQL corresponding Binlog view

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.