Cent os mysql主从同步问题

来源:互联网 发布:传智播客python怎么样 编辑:程序博客网 时间:2024/06/05 08:09

查看从库报错

 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;



0 0
原创粉丝点击