MySQL8.0.36 GTID主从同步失败排查

报错信息:

  Last_SQL_Error: Coordinator stopped because there were error(s) in the worker(s). The most recent failure being: Worker 1 failed executing transaction '6f577885-e5d0-11ee-a94a-0242c0a80067:1' at source log 7364ffd6441c-bin.000006, end_log_pos 724. See error log and/or performance_schema.replication_applier_status_by_worker table for more details about this failure or others, if any.

根据报错信息查看具体内容

select * from performance_schema.replication_applier_status_by_worker\G

解析binlog日志查看

 mysqlbinlog -vvv 7364ffd6441c-bin.000006

 

 看起来因该是主库的的一个school库被手动删除,而从库中没有这个school导致binlog不一致出现报错,那么只要在从库中将这个事务手动的跳过即可

首先停止线程

stop slave;

跳过事务

set @@session.gtid_next='6f577885-e5d0-11ee-a94a-0242c0a80067:1';
begin;
commit;
Set @@SESSION.GTID_NEXT = AUTOMATIC;

启动线程检查复制关系

start slave;
show slave status\G

相关推荐

  1. mysql主从同步

    2024-04-04 14:04:01       24 阅读

最近更新

  1. docker php8.1+nginx base 镜像 dockerfile 配置

    2024-04-04 14:04:01       94 阅读
  2. Could not load dynamic library ‘cudart64_100.dll‘

    2024-04-04 14:04:01       100 阅读
  3. 在Django里面运行非项目文件

    2024-04-04 14:04:01       82 阅读
  4. Python语言-面向对象

    2024-04-04 14:04:01       91 阅读

热门阅读

  1. 适配器模式:桥接不兼容的接口

    2024-04-04 14:04:01       33 阅读
  2. 探索同步锁与单例模式:保证线程安全的实例化

    2024-04-04 14:04:01       36 阅读
  3. 代码审计与web安全第四章作业SQL注入

    2024-04-04 14:04:01       37 阅读
  4. 包含密钥的OMP压缩感知模拟(MATLAB)

    2024-04-04 14:04:01       38 阅读
  5. 微信小程序媒体查询

    2024-04-04 14:04:01       32 阅读
  6. python函数

    2024-04-04 14:04:01       35 阅读
  7. Ubuntu pycharm配置Conda环境

    2024-04-04 14:04:01       33 阅读
  8. mongodb 基础查询使用

    2024-04-04 14:04:01       36 阅读
  9. String

    2024-04-04 14:04:01       36 阅读