Cent os mysql主从同步问题

这篇博客主要讨论了在CentOS系统中遇到MySQL主从同步问题,具体表现为从库在执行Update_rows事件时遇到错误,错误信息为'Could not execute Update_rows event on table...Error_code: 1032; handler error HA_ERR_KEY_NOT_FOUND'。文章提供了一个解决此类问题的方法。

查看从库报错

 Last_SQL_Error: Could not execute Update_rows event on table bbs.cdb_myposts_21; Can't find record in 'myposts_21', Error_code: 1032; handler error HA_ERR_KEY_NOT_FOUND; the event's master log mysql_bin.000049, end_log_pos 181827944

解决办法:

一、从主库上查看该语句

[root@ yunwei]#/service/mysql/bin/mysqlbinlog -v --stop-position=181827944 /service/mysql/data/mysql_bin.000049 > /tmp/1.log
[root@ yunwei]#vim /tmp/1.log

mysql> desc myposts_21;

mysql>select * from myposts_21 where uid=1224921 and dateline=1470752289;

二、在从库插入,重启slave进程
INSERT INTO `bbs`.`myposts_21` (`uid`, `tid`, `pid`, `position`, `dateline`, `special`, `fid`) VALUES ('1224921', '9992763', '0', '60', '1470752289', '0', '0');
stop slave;
start slave;



评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值