My SQL 复制过程中,sql post thread如果执行某个SQL出错,则会自动停止并且在日志和show slave status中提示错误信息。

090303 22:36:31 [ERROR] Slave SQL: Could not execute

Delete_rows event on table CATY.buyer_info; Can’t find record in

‘buyer_info’, Error_code: 1032; handler error HA_ERR_KEY_NOT_FOUND; the

event’s master log mysql-bin.000004, end_log_pos 1581, Error_code: 1032

090303 22:36:31 [Warning] Slave: Can’t find record in ‘buyer_info’ Error_code: 1032

090303 22:36:31 [ERROR] Error running query, slave SQL thread aborted.

Fix the problem, and restart the slave SQL thread with “SLAVE START”.

We stopped at log ‘mysql-bin.000004′ position 1425

mysql> SHOW SLAVE STATUS \G

*************************** 1. row ***************************

Slave_IO_State: Waiting for master to send event

Master_Host: qadb27.qa.ebay.com

Master_User: slave_user

Master_Port: 3306

Connect_Retry: 60

Master_Log_File: mysql-bin.000004

Read_Master_Log_Pos: 1608

Relay_Log_File: qadb17-relay-bin.006018

Relay_Log_Pos: 251

Relay_Master_Log_File: mysql-bin.000004

Slave_IO_Running: Yes

Slave_SQL_Running: No

Replicate_Do_DB:

Replicate_Ignore_DB:

Replicate_Do_Table:

Replicate_Ignore_Table:

Replicate_Wild_Do_Table:

Replicate_Wild_Ignore_Table:

Last_Errno: 1032

Last_Error: Could not execute Delete_rows event on table

CATY.buyer_info; Can’t find record in ‘buyer_info’, Error_code: 1032;

handler error HA_ERR_KEY_NOT_FOUND; the event’s master log

mysql-bin.000004, end_log_pos 1581

Skip_Counter: 0

Exec_Master_Log_Pos: 1425

Relay_Log_Space: 10066

Until_Condition: None

Until_Log_File:

Until_Log_Pos: 0

Master_SSL_Allowed: No

Master_SSL_CA_File:

Master_SSL_CA_Path:

Master_SSL_Cert:

Master_SSL_Cipher:

Master_SSL_Key:

Seconds_Behind_Master: NULL

Master_SSL_Verify_Server_Cert: No

Last_IO_Errno: 0

Last_IO_Error:

Last_SQL_Errno: 1032

Last_SQL_Error: Could not execute Delete_rows event on table

CATY.buyer_info; Can’t find record in ‘buyer_info’, Error_code: 1032;

handler error HA_ERR_KEY_NOT_FOUND; the event’s master log

mysql-bin.000004, end_log_pos 1581

1 row in set (0.00 sec)

如果错误记录可以fix或者忽略,则可以设置GLOBAL SQL_SLAVE_SKIP_COUNTER忽略sql thread的错误。

mysql> STOP SLAVE;

Query OK, 0 rows affected (0.00 sec)

mysql> SET GLOBAL SQL_SLAVE_SKIP_COUNTER = 1;

Query OK, 0 rows affected (0.00 sec)

mysql>START SLAVE;

Query OK, 0 rows affected (0.01 sec)

mysql> SHOW SLAVE STATUS \G

*************************** 1. row ***************************

Slave_IO_State: Waiting for master to send event

Master_Host: qadb27.qa.ebay.com

Master_User: slave_user

Master_Port: 3306

Connect_Retry: 60

Master_Log_File: mysql-bin.000004

Read_Master_Log_Pos: 1608

Relay_Log_File: qadb17-relay-bin.006075

Relay_Log_Pos: 251

Relay_Master_Log_File: mysql-bin.000004

Slave_IO_Running: Yes

Slave_SQL_Running: Yes

Replicate_Do_DB:

Replicate_Ignore_DB:

Replicate_Do_Table:

Replicate_Ignore_Table:

Replicate_Wild_Do_Table:

Replicate_Wild_Ignore_Table:

Last_Errno: 0

Last_Error:

Skip_Counter: 0

Exec_Master_Log_Pos: 1608

Relay_Log_Space: 552

Until_Condition: None

Until_Log_File:

Until_Log_Pos: 0

Master_SSL_Allowed: No

Master_SSL_CA_File:

Master_SSL_CA_Path:

Master_SSL_Cert:

Master_SSL_Cipher:

Master_SSL_Key:

Seconds_Behind_Master: 0

Master_SSL_Verify_Server_Cert: No

Last_IO_Errno: 0

Last_IO_Error:

Last_SQL_Errno: 0

Last_SQL_Error:

1 row in set (0.00 sec)

避免数据不一致可以在slave DB上设置GLOBAL read_only=true或者一定的用户权限。

也可编写高效的自动检测脚本重起sql thread。

是复制就会有数据不一致的问题的。

mysql repaire_Repair MySQL Replication遇到的错误(一)相关推荐

  1. mysql 1236_Mysql主从同步Last_IO_Errno:1236错误解决方法

    Mysql主从同步的Last_IO_Errno:1236错误是什么原因呢,我们要如何来解决这个问题呢?下面和小编一起来看看关于此问题的记录与解决办法. 从服务器错误代码: Last_IO_Errno: ...

  2. Mysql 8 group replication组复制集群单主配置图解

    Mysql 8 MGR集群单主配置图解 声明与简介 本文的数据来自网络,部分代码也有所参照,这里做了注释和延伸,旨在技术交流,如有冒犯之处请联系博主及时处理.本文主要介绍mysql的MGR集群的配置. ...

  3. 账户系统db服务器为创建快照,Mysql 服务器同步(replication)设置.docx

    Mysql 服务器同步(replication)设置 Mysql 服务器同步(replication)设置MySQL支持单向.异步复制,复制过程中一个服务器充当主服务器,而一个或多个其它服务器充当从服 ...

  4. 宋利兵 mysql_《MySQL 5.7 Replication新特性》分享之互动问题解答

    分享主题 <MySQL 5.7 Replication新特性> 嘉宾介绍 宋利兵,MySQL研发工程师.2009年加入MySQL全球研发团队,从事MySQL复制相关功能的开发. 主题介绍 ...

  5. mysql 错误码1236_【MySql】MySQL Replication Fatal Error 1236

    环境:双M-M架构,其中一台B因为磁盘损坏,服务器异常重启.重启之后B上面的数据库正常运行,当时A 库报如下错误: Last_IO_Error: Got fatal error 1236 from m ...

  6. mysql unrecognized_service mysql start出错,mysql启动不了,解决mysql: unrecognized service错误...

    service mysql start出错,mysql启动不了,解决mysql: unrecognized service错误的方法如下: [root@ctohome.com ~]# service ...

  7. mysql sqlstate 28000_mysql ERROR 1045 (28000): 错误解决办法

    ERROR 1045 (28000): Access denied for user 'ODBC'@'localhost' (using password: NO) ERROR 1045 (28000 ...

  8. mysql多重主键错误,老师,jd_spider中数据插入Mysql时一直显示主键错误,求助~

    老师,jd_spider中数据插入Mysql时一直显示主键错误,求助~ 而且peewee会自动生成一个goods表的主键 万分感谢! 建立表的代码如下 from peewee import * db ...

  9. 操蛋的linux改mysql密码(1054和1819错误)

    最近买了阿里云的linux服务器,帮我装好tomcat,jdk,mysql镜像,不怎么会用,在朋友帮助下勉强启动,但是初始的mysql密码太过复杂.看了网上linux修改mysql密码的教程鱼龙混杂, ...

  10. mysql can_***MySQL错误:Can't connect to MySQL server (10060)

    解决方法: 1. 改表法. 可能是你的帐号不允许从远程登陆,只能在localhost.这个时候只要在localhost的那台电脑,登入mysql后,更改 "mysql" 数据库里的 ...

最新文章

  1. 浅谈 UC 国际信息流推荐
  2. 《技术的本质》2月24日part1
  3. 26、jdbc操作数据库(3)
  4. JavaScript DOM 4 - 属性 attribute vs property
  5. tar命令压缩和解压缩
  6. cnblog中添加数学公式支持
  7. python读取Himawari-8葵花8标准数据(HSD)
  8. gopro7怎么回看视频_gopro7推荐帧数设置 gopro7视频格式设置
  9. html关于圣诞节主题的网页,灵感: 8个以圣诞节为主题的网站欣赏
  10. [SEEDLabs] Meltdown Spectre Attack Labs
  11. Epicor系统二次开发
  12. cas-client单点登录客户端拦截请求和忽略/排除不需要拦截的请求URL的问题
  13. 什么是服务器?服务器是干什么用的?
  14. JS实现图结构封装,使用邻接表实现(广度优先搜索,深度优先搜索)
  15. html大一期末考试,2017年大学英语大一期末考试试题及答案
  16. java标识命名服务_阿里巴巴Java开发规约第一章编程规约-命名风格篇
  17. 人体疲劳程度检测,生理信号处理
  18. Soot的安装及其初步使用
  19. java 适合练手的java项目
  20. Uber新CEO:公司最早将于2019年IPO上市

热门文章

  1. Hexo NexT主题自定义背景图片
  2. AT070TN83 V1.0 背光不亮
  3. 伍斯特理工学院计算机,伍斯特理工大学
  4. php文件如何转为ppt,pdf文件转换成ppt文件 pdf如何转为ppt
  5. U盘有必要安全弹出吗??
  6. 视频剪辑计算机配置要求,对于视频剪辑工作,需要什么样的电脑配置才满足要求...
  7. 解决 Github用户名 变为 invalid-email-address 问题
  8. java中括号的匹配_java括号匹配算法
  9. 小波 奇异点 matlab,Matlab小波变换对于奇异点的检测.doc
  10. python中stack.stack_Python stack