您的位置:首页 > 数据库 > MySQL

Cent os mysql主从同步问题

2016-08-10 14:27 369 查看
查看从库报错

 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;
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息