mysql-5.6.20主从同步错误之Error_code: 1032; handler error HA_ERR_KEY_NOT_FOUND
2018-03-13 10:07
906 查看
mysql-5.6.20主从同步错误之Error_code: 1032; handler error HA_ERR_KEY_NOT_FOUND
方法一:
1.Error_code: 1032; handler error HA_ERR_KEY_NOT_FOUND 是主从更新时丢失数据,导致主从不一致,在从库上mysql> show slave status\G;结果如下
2.在master上,用mysqlbinlog 分析下出错的binlog日志在干什么:
/usr/local/mysql/bin/mysqlbinlog --no-defaults -v -v --base64-output=DECODE-ROWS mysql-bin.000042 | grep -A '10' 455223179
3.查询master和slave上对应的数据,主库有而从库没有
select * from log_silver where id=9097514\G;
4.把丢失的数据在slave上填补,然后跳过报错
mysql> insert into t1 values();
mysql> stop slave ;set global sql_slave_skip_counter=1;start slave;
5.查看同步结果
mysql> show slave status\G;
方法二:
1.如果用方法一还是不能主从同步,查询到这个错误是mysql的bug导致的
2.解决的办法:
1.最好的办法是升级数据库 保证bug不会重现。
2.利用配置参数 来躲避这个bug vi /etc/my.cnf
slave-skip-errors = 1032,xxxx,xxxx ....
3.临时逃避此次错误。
set global sql_slave_skip_counter=1; stop slave; start slave;
相关文章推荐
- mysql主从同步报错:Error_code: 1032; handler error HA_ERR_KEY_NOT_FOUND
- MySQL启动错误ERROR! MySQL server PID file could not be found的解决办法
- mysql主从库同步错误:1062 Error 'Duplicate entry '1438019' for key 'PRIMARY'' on query
- mysql 安装过程中的错误:my-template.ini could not be processed and written to XXX\my.ini.Error code-1
- Mysql主从库不同步1236错误:could not find first log file name in binary....
- nodejs错误:ld: library not found for -lgcc_s.10.5 clang: error: linker command failed with exit code 1 (use -v to see invocation)
- MysqL错误之_ERROR! MySQL server PID file could not be found!
- mysql 安装过程中的错误:my-template.ini could not be processed and written to XXX\my.ini.Error code-1
- [python]"python[error] mysql_config not found"错误解决方法
- ld: library not found for -lAFNetworking clang: error: linker command failed with exit code 1 (use -
- 在安装 Windows 过程中出现“Ntkrnlmp.exe Could Not Be Loaded. The Error Code Is 7”(无法加载 Ntkrnlmp.exe。错误代码是 7)错误消息
- mysql无法启动ERROR! MySQL is running but PID file could not be found ?
- 更新证书错误Code Sign error: Provisioning profile ‘XXXX'can't be found
- keytool错误: java.io.FileNotFoundException: android.key (Permission denied)
- mysql 启动错误 - server PID file could not be found
- scrapy错误之KeyError: 'XXX does not support field: xxx'
- MySQL主从复制:ERROR 1201 (HY000): Could not initialize master info structure.
- could not start the service mysql error:0错误
- MySQL学习6_ERROR! MySQL server PID file could not be found!解决方法
- Mysql启动出现MySQL server PID file could not be found 错误