美文网首页
MySQL系列-复制异常错误汇总

MySQL系列-复制异常错误汇总

作者: 开心的蛋黄派 | 来源:发表于2023-11-23 16:36 被阅读0次

    错误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

    修复手段: 根据记录分析出具体的缺失记录手动插入即可

    错误1062

    错误信息: Duplicate entry ‘…’ for key 'PRIMARY

    修复手段:根据主键删除重复记录

    错误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;

    错误1236

    错误信息: Got fatal error 1236 from master when reading data from binary log: 'Could not find first log file name in binary log index

    错误解决:从新搭建从库

    错误信息: 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

    错误解决: stop slave; && CHANGE MASTER TO MASTER_LOG_FILE=Relay_Master_Log_File+1,MASTER_LOG_POS=0; &&start slave;

    错误no_disk_space

    错误信息: Error writing file '/tmp/MYYEBa32' no space /tmp

    错误解决: 调整mysql tmpdir=/mnt/sdc/mysql_tmp 重启mysql服务

    错误uuid_same

    错误信息 A slave with the same server_uuid/server_id as this slave has connected to the master;

    问题解决

     1 搭建新从库 拷贝了data目录一定要删除auto.cnf文件

      2 修改my.cnf的server-id文件

    错误waiting for slave

      错误信息: waiting for slave workers to process their queues  复制进程正常,但是位点信息不变

      问题解决 1 stop slave 此操作需要时间比较长,需要等待哈,个人经验几分钟

                     2 设置 slave_parallel_workers=1 相当于关掉了并行复制

                      3  start slave

    相关文章

      网友评论

          本文标题:MySQL系列-复制异常错误汇总

          本文链接:https://www.haomeiwen.com/subject/pwrgwdtx.html