这一篇写写复制错误处理相关的另两个参数slave_skip_errors、slave_exec_mode,基本环境参考《复制错误处理——sql_slave_skip_counter

一、slave_skip_errors

1.1、slave_skip_errors官方解释

https://dev.mysql.com/doc/refman/5.7/en/replication-options-slave.html
--slave-skip-errors=[err_code1,err_code2,...|all|ddl_exist_errors]
Normally, replication stops when an error occurs on the slave, which gives you the opportunity to resolve the inconsistency in the data manually. This option causes the slave SQL thread to continue replication when a statement returns any of the errors listed in the option value.
Do not use this option unless you fully understand why you are getting errors. If there are no bugs in your replication setup and client programs, and no bugs in MySQL itself, an error that stops replication should never occur. Indiscriminate use of this option results in slaves becoming hopelessly out of synchrony with the master, with you having no idea why this has occurred.

1.2、测试数据

slave_skip_errors是一个非Dynamic变量,在配置文件中添加

[mysqld]
slave_skip_errors=1032,1062
View Code

相关文章: