Set the relationship between the master and slave binlog_format.

Source: Internet
Author: User

Set the relationship between the master and slave binlog_format.
1. The master database is row, and the slave database must be row/mixed. If statement is used, the slave database reports the following error when the master database changes (no matter what changes, such as insert/update/delete/alter ):
Last_Error: Error executing row event: 'Could not execute statement: impossible to write to binary log since statement is in row format and BINLOG_FORMAT = STATEMENT. '2. the master database is statement and the slave database can be in any mode (statement, mixed, or row), but data inconsistency may occur. Therefore, it is not recommended to use this mode.
3. The master database is mixed, and the slave database must be in row/mixe format. If the slave database is statement, the master database generally modifies the data and does not report an error. In special cases, the slave database reports the following error.
Last_Error: Error executing row event: 'Could not execute statement: impossible to write to binary log since statement is in row format and BINLOG_FORMAT = STATEMENT. 'The General situation mentioned above is that the master database records binlog in the statement format. The special case mentioned above is that the master database records the binlog in the row format. Specific to the following types:

(1) when using the UUID () function
(2) when one or more tables with AUTO_INCREMENT columns are updated and 'trigger' or 'stored function' is called
(3) Executing INSERT DELAYED
(4) When a part of a view needs row-based replication (for example, UUID (), the statement used to create the view is changed to row-based.
(5) When using user-defined functions (udfs)
(6) When a statement is determined to be row-based and its session needs to use a temporary table, all sub-statements in the session will be recorded in the ROW format.
(7) When using USER (), CURRENT_USER () or CURRENT_USER
(8) When the statement references one or more system variables.
(9) When LOAD_FILE () is used ()

For details about how mysql records mixed as row, see the official documentation:
Https://dev.mysql.com/doc/refman/5.7/en/binary-log-mixed.html

 

 

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.