mysql系列~复制异常
2022/4/5 19:21:08
本文主要是介绍mysql系列~复制异常,对大家解决编程问题具有一定的参考价值,需要的程序猿们随着小编来一起学习吧!
1 错误代码:-1032
错误信息: Slave SQL: Could not execute Delete_rows event on table zabbix.history; Can't find record in 'history', Error_code: 1032; handler error HA_ERR_KEY_NOT_FOUND; the event's master log mysql-bin.003228, end_log_pos 435659530, Error_code: 1032
[Warning] Slave: Can't find record in 'history' Error_code: 1032
错误分析:delete/update 无法找到记录
修复手段:根据记录分析出具体的缺失记录手动插入即可
2 错误代码:-1062
错误信息: Duplicate entry ‘…’ for key 'PRIMARY
错误分析:insert 重复记录
修复手段:根据主键删除重复记录
3 复制错误:-1256
错误信息: Relay log read failure: Could not parse relay log event entry. The possible reasons are: the master's binary log is corrupted (you can check this by running 'mysqlbinlog' on the binary log), the slave's relay log is corrupted (you can check this by running 'mysqlbinlog' on the relay log), a network problem, or a bug in the master's or slave's MySQL code. If you want to check the master's binary log or slave's relay log, you will be able to know their names by issuing 'SHOW SLAVE STATUS' on this slave.
错误分析: 由于服务器异常重启导致的错误,需要重新指定
错误解决 stop slave; && CHANGE MASTER TO MASTER_LOG_FILE=Relay_Master_Log_File,MASTER_LOG_POS=Exec_Master_Log_Pos; && start slave;
4 复制错误:-1236
错误信息: Got fatal error 1236 from master when reading data from binary log: 'Could not find first log file name in binary log index
错误分析: 由于mysql主库缺少从库所需要的binlog导致的,需要重做从库
错误解决:从新搭建从库
5 复制错误:-1236
错误信息: Got fatal error 1236 from master when reading data from binary log: 'binlog truncated in the middle of event; consider out of disk space on master
错误分析: mysql 主节点binlog被截断,可能由多种原因,比如磁盘满 异常重启等
错误解决: stop slave; && CHANGE MASTER TO MASTER_LOG_FILE=Relay_Master_Log_File+1,MASTER_LOG_POS=0; &&start slave;
6 复制错误:
错误信息: Error writing file '/tmp/MYYEBa32' no space /tmp
错误分析: 从库/tmp目录打满
错误解决: 调整mysql tmpdir=/mnt/sdc/mysql_tmp 重启mysql服务
这篇关于mysql系列~复制异常的文章就介绍到这儿,希望我们推荐的文章对大家有所帮助,也希望大家多多支持为之网!
- 2024-12-25如何部署MySQL集群资料:新手入门教程
- 2024-12-24MySQL集群部署资料:新手入门教程
- 2024-12-24MySQL集群资料详解:新手入门教程
- 2024-12-24MySQL集群部署入门教程
- 2024-12-24部署MySQL集群学习:新手入门教程
- 2024-12-24部署MySQL集群入门:一步一步搭建指南
- 2024-12-07MySQL读写分离入门:轻松掌握数据库读写分离技术
- 2024-12-07MySQL读写分离入门教程
- 2024-12-07MySQL分库分表入门详解
- 2024-12-07MySQL分库分表入门指南