首页 > 数据库 >MySQL 从库同步数据报错: Can't find record in '表名', Error_code: 1032; handler error HA_ERR_KEY

MySQL 从库同步数据报错: Can't find record in '表名', Error_code: 1032; handler error HA_ERR_KEY

时间:2024-03-06 17:13:02浏览次数:19  
标签:code end log pos 报错 mysql 从库

由于两边数据不一致,主库host表的某条数据在从库不存在,导致同步时执行update报错。

 修复的原理很简单,找到主从不一致的这条数据,在从库补上,让update能执行就好。由于需要从binlog里找数据,需要确保中断之后的binlog没被删除,否则就只能重搭了。

导出日志:

mysqlbinlog -v --stop-position=265980893 /binlog_path/mysql-bin.000641 > /tmpbinlog.log

查询记录end_log_pos=537973695所在位置,找到对应update语句;

找到对应的数据再从库中手动添加进去,然后重启slave。

翻译

搜索

复制

<iframe></iframe>

标签:code,end,log,pos,报错,mysql,从库
From: https://www.cnblogs.com/xxhxs-21/p/18057029

相关文章

  • SpringBoot整合Log4j2日志框架
    SpringBoot底层默认使用logback日志框架。切换使用Log4j2日志框架。pom.xml配置<!--web场景启动器--><dependency><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-web</artifactId> <!--排除默认日志框架--><......
  • 代码随想录算法训练营day14 | leetcode 144. 二叉树的前序遍历、145. 二叉树的后序遍
    目录题目链接:144.二叉树的前序遍历-简单题目链接:145.二叉树的后序遍历-简单题目链接:94.二叉树的中序遍历-简单递归三要素:确定递归函数的参数和返回值:确定哪些参数是递归的过程中需要处理的,那么就在递归函数里加上这个参数,并且还要明确每次递归的返回值是什么进而确定递归......
  • 【UVM】 【source_code】 uvm_cmdline_processor
    classuvm_cmdline_processor 函数get_arg_values()用于收集命令行(commandline)中匹配的参数,便于后续处理。返回所有匹配上的参数数量,所有匹配上的参数词尾被存放在values[$]中。sourcecodefunctionintget_arg_values(stringmatch,refstringvalues[$]);  int......
  • leetcode-15. 三数之和 - 双指针问题
    classSolution:defthreeSum(self,nums:List[int])->List[List[int]]:nums.sort()res=[]mem=set()foriinrange(len(nums)):ifnums[i]>0:breakifi>0andnum......
  • LeetCode75 1768.交替合并字符串
    1768.交替合并字符串https://leetcode.cn/problems/merge-strings-alternately/description/?envType=study-plan-v2&envId=leetcode-75publicStringmergeAlternately(Stringword1,Stringword2){intlen1=word1.length();intlen2=word2.length()......
  • 记录一次WPF命令参数报错,InvalidCastException: T for DelegateCommand<T> is not an
    在使用WPF的时候对int或者bool类型进行绑定出现InvalidCastException:TforDelegateCommandisnotanobjectnorNullable.<ButtonWidth="200"Height="30"Content="按钮"Command="{BindingOpenCommand}"CommandParameter="{Binding......
  • Codeforces Round 932 (Div. 2)
    CodeforcesRound932(Div.2)A-EntertainmentinMAC解题思路:如果翻转字符小于原字符,那么一直翻转即可。否则,翻转\(n-1\)次,然后添加一次。代码:#include<bits/stdc++.h>usingnamespacestd;usingll=longlong;usingpii=pair<ll,ll>;typedefdoubledb;......
  • VSCode 发布时报error MSB4018: “CreateAppHost”任务意外失败
    大概率是杀毒软件问题,我的问题是有360杀毒导致的网上的方案有如下,也都进行了尝试:重启VisualStudio以管理员身份运行VisualStudio清理解决方案删除bin目录下的所有文件均无效,无奈之下继续寻找解决方案,发现用ProcessMonitor来监控到底是谁在搞鬼。通过下载ProcessMo......
  • leedcode 位1的数量
    自己写的classSolution:defhammingWeight(self,n:int)->int:#将整数n转换为二进制字符串,去除前缀'0b'n_str=bin(n)[2:]#用于存储'1'的列表res_li=[]#遍历二进制字符串的每一位foriinn_str:......
  • leedcode 颠倒二进制
    使用bin函数classSolution:defreverseBits(self,n:int)->int:#将整数n转换为二进制字符串,并用左0填充至32位binary_str=bin(n)[2:].zfill(32)#反转二进制字符串reversed_str=binary_str[::-1]#将反转后的......