Description of MySQL5.5 master-slave replication (triggers, functions, storage engines, and event processing)

Source: Internet
Author: User

Mysql5.5 master-slave replication of triggers, functions, storage engines, and events.

I. There are three modes for MySQL master-slave replication.

1. binlog_format = row: the log records each row of data in the modified form (record page), and then modifies the same data on the slave side.

2. binlog_format = statement: Each SQL statement that modifies data is recorded in the bin-log of the master. When the Server Load balancer instance is copied, the SQL process will parse the same SQL statement that was previously executed on the master end and execute it again.

3. binlog_format = mixed: This mode is available only after version 5.1.8. mixed is the hybrid mode of row and statement.

Ii. Master-slave replication of the trigger.

A. When binlog_format = statement or binlog_format = mixed (the statement mode is used in mixed Mode)

1. During master-slave replication, the master-slave trigger is subject to the definer clause. Only the master-slave user can run the trigger normally.

2. the SQL statement on the master server is uploaded to the slave server, and the slave server executes the SQL statement to trigger the trigger on the slave server (the description here is: the master server will not pass the triggered SQL statement to the slave server ).

Here we can see that the pass is the original SQL statement.

B. When binlog_format = row or binlog_format = mixed (the mixed mode uses the row mode ),

1. The master server copies the modified page to the slave server, and the modified page value is the changed value after triggering.

2. Because the value of this page is changed after triggering, you do not need this trigger on the slave server.

3. Delete the trigger on the slave server. the same value as the master server can be obtained.

  • 1
  • 2
  • 3
  • Next Page

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.