Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Example Analysis of synchronization error in slave_exec_mode Parameter processing in mysql

2025-01-15 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)05/31 Report--

This article mainly introduces the example analysis of slave_exec_mode parameter processing synchronization errors in mysql, which is very detailed and has a certain reference value. Interested friends must read it!

There are three kinds of synchronization errors frequently encountered in MySQL master-slave synchronization:

1. Delete a record on master. If there is no such data on slave, an error will occur.

2. Insert a record on master. If the primary key value already exists on slave, an error will occur.

3. Update a record on master. If there is no such data on slave, an error will occur.

If the my.cnf of slave has been configured with the slave_skip_errors parameter, you can skip the error automatically. If the parameter is not configured, you can solve it by using the following methods:

Click (here) to collapse or open

Mysql > set global slave_exec_mode='idempotent'

Query OK, 0 rows affected (0.02 sec)

The default is strict (strict mode)

After the setting is completed, it does not take effect immediately. You need to restart the replication process.

Stop slave

Start slave

The above is all the contents of the article "sample Analysis of slave_exec_mode Parameter handling synchronization errors in mysql". Thank you for reading! Hope to share the content to help you, more related knowledge, welcome to follow the industry information channel!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report