MySQL --slave-skip-errors
2013-10-11 16:29
363 查看
官方说明:
(MySQL Cluster NDB 7.0.33 and later; MySQL Cluster NDB 7.1.22 and later:)
Normally, replication stops when an error occurs on the slave. This gives you the opportunity to resolve the inconsistency in the data manually. This option tells 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.
Note
Prior to MySQL 5.1.35, this option had no effect with row-based logging. (Bug #39393)
For error codes, you should use the numbers provided by the error message in your slave error log and in the output of
You can also (but should not) use the very nonrecommended value of
For MySQL Cluster Replication in MySQL Cluster NDB 7.0 beginning with version 7.0.33 and MySQL Cluster NDB 7.1 beginning with version 7.1.22, an additional shorthand value
Examples:
如果从库主要用作主库的备份,那么就不应该使用这个启动参数。设置不当,很可能造成主从数据库的数据不同步。但是,如果从数据库仅仅是为了分担主数据库的查询压力,且对数据的完整性要求不是很严格,那么这个选项的确可以减轻数据库管理员维护从数据看的工作量。[/code]
--slave-skip-errors=[,...|all][/code]err_code1,[code]err_code2
(MySQL Cluster NDB 7.0.33 and later; MySQL Cluster NDB 7.1.22 and later:)
--slave-skip-errors=[,...|all|ddl_exist_errors][/code]err_code1,[code]err_code2
Command-Line Format | --slave-skip-errors=name |
Option-File Format | slave-skip-errors |
System Variable Name | slave_skip_errors |
Variable Scope | Global |
Dynamic Variable | No |
Permitted Values (>= 5.1.61-ndb-7.0.33,5.1.61-ndb-7.1.22) | |
Type | string |
Default | OFF |
Valid Values | [list of error codes] |
all | |
ddl_exist_errors |
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.
Note
Prior to MySQL 5.1.35, this option had no effect with row-based logging. (Bug #39393)
For error codes, you should use the numbers provided by the error message in your slave error log and in the output of
SHOW SLAVE STATUS. Appendix C, Errors, Error Codes, and Common Problems, lists server error codes.
You can also (but should not) use the very nonrecommended value of
allto cause the slave 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 slave's data is not anywhere close to what it is on the master. You have been warned.
For MySQL Cluster Replication in MySQL Cluster NDB 7.0 beginning with version 7.0.33 and MySQL Cluster NDB 7.1 beginning with version 7.1.22, an additional shorthand value
ddl_exist_errorsis supported for use with the enhanced failover mechanism which is implemented in that and later version of MySQL Cluster NDB 7.2. This value is equivalent to the error code list
1007,1008,1050,1051,1054,1060,1061,1068,1094,1146. This value is not supported by the mysqld binary included with the MySQL Server 5.1 distribution. (Bug #11762277, Bug #54854) For more information, see Section 17.6.8, “Implementing Failover with MySQL Cluster Replication”.
Examples:
--slave-skip-errors=1062,1053 --slave-skip-errors=all --slave-skip-errors=ddl_exist_errors
System variables used on replication slaves. The following list describes system variables for controlling replication slave servers. They can be set at server startup and some of them can be changed at runtime using[code]SET. Server options used with replication slaves are listed earlier in this section.
如果从库主要用作主库的备份,那么就不应该使用这个启动参数。设置不当,很可能造成主从数据库的数据不同步。但是,如果从数据库仅仅是为了分担主数据库的查询压力,且对数据的完整性要求不是很严格,那么这个选项的确可以减轻数据库管理员维护从数据看的工作量。[/code]
相关文章推荐
- mysql运维-slave_skip_errors
- mysql中的主从复制slave-skip-errors参数使用方法
- mysql主从之slave-skip-errors和sql_slave_skip_counter
- mysql中的主从复制slave-skip-errors参数使用方法
- MySQL之slave_skip_errors选项
- mysql之slave_skip_errors选项
- mysql参数之slave_skip_errors
- mysql 的 slave-skip-errors 使用
- MySQL SET GLOBAL SQL_SLAVE_SKIP_COUNTER = N 的解释
- mysql 同步GLOBAL sql_slave_skip_counter解释
- mysql 小误区 关于set global sql_slave_skip_counter=N 命令的迷惑
- 关于 mysql SET GLOBAL sql_slave_skip_counter = N 的一点记录
- MySQL参数sql_slave_skip_counter和slave_exec_mode进一步认识
- MySQL 之 set global sql_slave_skip_counter=N 命令
- MySQL小误区:关于set global sql_slave_skip_counter=N 命令的一些点
- mysql 同步GLOBAL sql_slave_skip_counter解释
- MySQL的一次错误处理 SQL_SLAVE_SKIP_COUNTER
- MySQL小误区:关于set global sql_slave_skip_counter=N 命令的一些点
- MySQL小误区:关于set global sql_slave_skip_counter=N 命令的一些点
- MySQL小误区:关于set global sql_slave_skip_counter=N 命令的一些点