--slave-skip-errors=[err_code1,err_code2, ... | all | ddl_exist_errors]
Normally, replication stops when an error occurs on the replica, which gives you the opportunity to resolve the inconsistency in the data manually. This option causes the replication SQL thread to continue replication when a statement returns any of the errors listed in the option value.
正常情况下,当有error时复制会中断,给机会手动解决数据不一致的问题。 slave-skip-errors 会使sql 线程忽略这些error 继续复制。
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 replicas becoming hopelessly out of synchrony with the source, with you having no idea why this has occurred.不要随便使用此参数,除非你完全了解为什么会报错。 在复制配置,客户端没有错误的情况下,Mysql 本身没有bug的情况下,复制是不会中断的。 随意的使用此参数会导致主从不一致。
For error codes, you should use the numbers provided by the error message in the replica's error logand in the output of SHOW SLAVE STATUS. Appendix B, Error Messages and Common Problems, lists server error codes.对于错误codes, 可以通过show slave status的输出信息进行查看。
The shorthand value ddl_exist_errors is equivalent to the error code list1007,1008,1050,1051,1054,1060,1061,1068,1094,1146.相面列出了较为常见的ddl_exist_errors ,
1007,1008,1050,1051,1054,1060,1061,1068,1094,1146.
You can also (but should not) use the very nonrecommended value of all to cause the replica to ignore all error messages and keeps going regardless of what happens. Needless to say, if you use all, there are no guarantees regarding the integrity of your data. Please do not complain (or file bug reports) in this case if the replica's data is not anywhere close to what it is on the source. You have been warned.
Examples:--slave-skip-errors=1062,1053--slave-skip-errors=all--slave-skip-errors=ddl_exist_errors
参考文档:https://dev.mysql.com/doc/refman/5.7/en/replication-options-replica.html#option_mysqld_slave-skip-errors
slave-skip-errors
来源:这里教程网
时间:2026-03-01 15:59:08
作者:
编辑推荐:
下一篇:
相关推荐
-
雷神推出 MIX PRO II 迷你主机:基于 Ultra 200H,玻璃上盖 + ARGB 灯效
2 月 9 日消息,雷神 (THUNDEROBOT) 现已宣布推出基于英
-
制造商 Musnap 推出彩色墨水屏电纸书 Ocean C:支持手写笔、第三方安卓应用
2 月 10 日消息,制造商 Musnap 现已在海外推出一款 Oce
热文推荐
- slave-skip-errors
slave-skip-errors
26-03-01 - sql_slave_skip_counter
sql_slave_skip_counter
26-03-01 - 上线SAP系统能给半导体公司带来哪些助益
上线SAP系统能给半导体公司带来哪些助益
26-03-01 - 详解SQL中的表值参数
详解SQL中的表值参数
26-03-01 - innodb_flush_log_at_trx_commit
innodb_flush_log_at_trx_commit
26-03-01 - MySQL备份与恢复——基于MyDumper/MyLoader 逻辑备份恢复
- sync_binlog
sync_binlog
26-03-01 - 如何在MySQL中实现替换字段部分内容
如何在MySQL中实现替换字段部分内容
26-03-01 - SAP管理软件系统优点概述
SAP管理软件系统优点概述
26-03-01 - 总结MySQL存储引擎MyISAM与InnoDB区别
总结MySQL存储引擎MyISAM与InnoDB区别
26-03-01
