博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
5.6 GTID 启用情况下, 从库跳过一个事物的方法 sql_slave_skip_counter 失效.
阅读量:2496 次
发布时间:2019-05-11

本文共 1583 字,大约阅读时间需要 5 分钟。

5.6 数据库报错了.    

从库 报错了,之前 现在从库上删除了一条垃圾表, 

然后在主库上 删除了 垃圾表, 然后从库报错. 

           Last_IO_Errno: 0

                Last_IO_Error: 

               Last_SQL_Errno: 1051

               Last_SQL_Error: Error 'Unknown table 'yq_user_reg_invit_bak20160222'' on query. 

Default database: ''. Query: 'DROP TABLE `yq_user_reg_invit_bak20160222` /* generated by server */'

  Replicate_Ignore_Server_Ids: 

             Master_Server_Id: 110

                  Master_UUID: dfd7a18d-a9aa-11exxxxxxxxxxxxxxxxxxxxxx

             Master_Info_File: mysql.slave_master_info

                    SQL_Delay: 0

          SQL_Remaining_Delay: NULL

      Slave_SQL_Running_State: 

           Master_Retry_Count: 86400

                  Master_Bind: 

      Last_IO_Error_Timestamp: 

     Last_SQL_Error_Timestamp: 190304 16:19:05

               Master_SSL_Crl: 

           Master_SSL_Crlpath: 

           Retrieved_Gtid_Set: dfd7a18d-a9aa-11e8-afe5-40f2e99dd7d2:1-256481574

            Executed_Gtid_Set: a29497dd-afe8-11e8-9898-40f2e9dc3512:1-2,

dfd7a18d-a9aa-11e8-afe5-40f2e99dd7d2:1-256461742

                Auto_Position: 1

1 row in set (0.00 sec)

stop  slave 以后   执行   sql_slave_skip_counter  + 1  之后 , 不管用了. 

mysql.youqianhua.sock@(none)> set global sql_slave_skip_counter=1 ;

ERROR 1858 (HY000): sql_slave_skip_counter can not be set when the server is running with @@GLOBAL.GTID_MODE = ON. Instead, for each transaction that you want to skip, generate an empty transaction with the same GTID as the transaction

那么新的方案就要跟上了.  

stop  slave;

set   gtid_next='dfd7a18d-a9aa-11e8-afe5-40f2e99dd7d2:256461743' ; 

begin;

commit;

SET gtid_next = 'AUTOMATIC';

start slave ; 

根据 指示 操作就行了.   注意 gtid 跟  show  slave  status 中输出的  next gtid 的写法的差异  + 1  了. 

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/133735/viewspace-2637504/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/133735/viewspace-2637504/

你可能感兴趣的文章
Laravel 的生命周期
查看>>
CentOS Docker 安装
查看>>
Nginx
查看>>
Navicat远程连接云主机数据库
查看>>
Nginx配置文件nginx.conf中文详解(总结)
查看>>
Mysql出现Table 'performance_schema.session_status' doesn't exist
查看>>
MySQL innert join、left join、right join等理解
查看>>
vivado模块封装ip/edf
查看>>
sdc时序约束
查看>>
Xilinx Jtag Access/svf文件/BSCANE2
查看>>
NoC片上网络
查看>>
开源SoC整理
查看>>
【2020-3-21】Mac安装Homebrew慢,解决办法
查看>>
influxdb 命令行输出时间为 yyyy-MM-dd HH:mm:ss(年月日时分秒)的方法
查看>>
已知子网掩码,确定ip地址范围
查看>>
判断时间或者数字是否连续
查看>>
docker-daemon.json各配置详解
查看>>
Docker(一)使用阿里云容器镜像服务
查看>>
Docker(三) 构建镜像
查看>>
FFmpeg 是如何实现多态的?
查看>>