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
![](https://img-blog.csdn.net/20160810142349005?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQv/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/Center)
mysql> desc myposts_21;
![](https://img-blog.csdn.net/20160810142402240?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQv/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/Center)
mysql>select * from myposts_21 where uid=1224921 and dateline=1470752289;
![](https://img-blog.csdn.net/20160810142356912?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQv/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/Center)
二、在从库插入,重启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;
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;
相关文章推荐
- Mysql-5.5.3 主从同步不支持master-host问题的解决办法
- Mysql-5.5.3-m3 主从同步不支持master-host问题的解决办法
- MySQL 主从同步容易出现的问题
- MySQL主从同步 问题定位
- Mysql主从同步问题汇总
- cent os5.2下编译安装mysql碰到的问题
- 在cent os 下安装 mysql出现了点问题
- mysql主从同步中应注意的问题
- MySQL主从同步的一个小问题解决
- 记1次未正确设置replicate-ignore-db参数导致MySQL主从同步异常的问题
- mysql主从同步问题思考
- mysql主从同步报错问题
- mysql主从同步问题
- Mysql主从同步延迟问题及解决方案
- mysql主从同步从库上Slave_IO_Running: Connecting问题
- mysql主从同步问题
- mysql 主从同步 Error 'Out of range value for column的问题
- MYSQL同步--主从同步问题集锦
- mysql主从同步问题解决汇总
- mysql主从同步-问题梳理