[Architecture] MySQL Log File-Binary Log: Binary Log & amp; Binary Log Index

Source: Internet
Author: User

[Architecture] MySQL Log File-Binary Log: Binary Log & Binary Log Index first find these two files, [plain] Rocky @ localhost> show variables like 'datadir '; + --------------- + bytes + | Variable_name | Value | + --------------- + bytes + | datadir |/home/mysql/data/| + --------------- + ----------------------- + 1 row in set (0.00 sec) rocky @ localhost> system ls-l/home/mysql/data/total 31804-rw ---- 1 mysql dba 18874368 Apr 14 ibdata1-rw ---- 1 mysql dba 5242880 Apr 15 ib_logfile0-rw ---- 1 mysql dba 5242880 Apr 12 ib_logfile1-rw ---- 1 mysql dba 6 Apr 15 localhost. localdomain. pid drwxr-xr-x 2 mysql dba 4096 Apr 12 mysql-rw ---- 1 mysql dba 27828 Apr 12 mysql-bin.000001-rw ---- 1 mysql dba 997144 Apr 12 mysql-bin.000002 -rw ---- 1 mysql dba 150 Apr 12 mysql-bin.000003-rw ---- 1 mysql dba 27025 Apr 12 mysql-bin.000004-rw ---- 1 mysql dba 997144 Apr 12 mysql-bin.000005- rw-rw ---- 1 mysql dba 27025 Apr 12 mysql-bin.000006-rw ---- 1 mysql dba 997144 Apr 12 mysql-bin.000007-rw ---- 1 mysql dba 126 Apr 12 mysql-bin.000008-rw -rw ---- 1 mysql dba 126 Apr 13 mysql-bin.000009-rw ---- 1 mysql dba 1346 Apr 13 mysql-bin.000010-rw ---- 1 mysql dba 150 Apr 13 mysql-bin.000011-rw- rw ---- 1 mysql dba 107 Apr 13 mysql-bin.000012-rw ---- 1 mysql dba 107 Apr 13 mysql-bin.000013-rw ---- 1 mysql dba 126 Apr 13 mysql-bin.000014-rw ---- 1 mysql dba 229 Apr 14 0mysql-bin.000015-rw ---- 1 mysql dba 107 Apr 15 mysql-bin.000016-rw ---- 1 mysql dba 304 Apr 15 mysql-bin.index (I) Definitions record all modify the query of data, including: query statement, execution time, resources consumed, and related transaction information (ii) function ① recovery ② copy (3) There are many parameters related to relevant parameters. Here we will focus on one: binlog_format meaning: log format: dynamic parameter, session level, or global level set @ session. binlog_format = 'row' or set global binlog_format = 'row'; values: ● STATEMENT adopts this format for replication and SQL Apply similar to the Oracle logic standby ● ROW based replication and Oracle physical standby Redo Apply for the advantages of enabling ROW: ① if we set the transaction isolation level of InnoDB to read commited and add ROW, we can get better concurrency. ② It brings better reliability to recovery and replication. Disadvantages: ① fast expansion of binary logs and high disk space overhead ② High replication and network bandwidth requirements ● MIXED is the default format, which is tricky. It runs in STATEMENT at ordinary times, and sometimes runs in ROW [plain] Rocky @ localhost> show variables like 'binlog _ format '; + --------------- + ------- + | Variable_name | Value | + --------------- + ------- + | binlog_format | MIXED | + --------------- + ------- + 1 row in set (0.00 sec)

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.