MySQL's Binlog

Source: Internet
Author: User

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

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.