码迷,mamicode.com
首页 > 数据库 > 详细

mysql 主从复制 忽略错误

时间:2016-08-10 14:31:01      阅读:834      评论:0      收藏:0      [点我收藏+]

标签:mysql slave_skip_errors

mysql主从复制,经常会遇到错误而导致slave端复制中断,这个时候一般就需要人工干预,跳过错误才能继续
跳过错误有两种方式:
1.跳过指定数量的事务:
mysql>slave stop;
mysql>SET GLOBAL SQL_SLAVE_SKIP_COUNTER = 1        #跳过一个事务
mysql>slave start

2.修改mysql的配置文件,通过slave_skip_errors参数来跳所有错误或指定类型的错误
vi /etc/my.cnf
[mysqld]
#slave-skip-errors=1062,1053,1146 #跳过指定error no类型的错误
#slave-skip-errors=all #跳过所有错误


1062   Duplicate entry ‘1438019‘ for key ‘PRIMARY‘‘ on query

1146  Table doesn’t exist

1032; handler error HA_ERR_KEY_NOT_FOUND;

1060:1060 Duplicate column name ‘ID‘ 



mysql 主从复制 忽略错误

标签:mysql slave_skip_errors

原文地址:http://120662.blog.51cto.com/110662/1836497

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!