1、报错如下:

Got fatal error  from master when reading data from binary log: 'The slave is connecting using CHANGE MASTER TO MASTER_AUTO_POSITION = 1, but the master has purged binary logs containing GTIDs that the slave requires.'

2、问题解决:

  查看master gtid_purged

 show global variables like '%gtid%';
找到gtid_purged的值

3、从库执行:

mysql> stop slave;
Query OK, rows affected (0.18 sec) mysql> reset slave;
Query OK, rows affected (1.29 sec) mysql> reset master;
Query OK, rows affected (1.18 sec) mysql> set @@global.gtid_purged='你的GITD值';
Query OK, rows affected (2.12 sec) mysql> change master to master_host='MASTER_IP',master_port=PORT,master_user='USERNAME',master_password='PASSWORD',master_auto_position=;
Query OK, rows affected, warnings (5.55 sec) mysql> start slave;
Query OK, rows affected (0.40 sec) mysql> show slave status \G
*************************** . row ***************************
Slave_IO_State: Queueing master event to the relay log
Master_Host: xxx
Master_User: xxx
Master_Port: xxx
Connect_Retry:
Master_Log_File: mysql-bin.
Read_Master_Log_Pos:
Relay_Log_File: mysql-relay.
Relay_Log_Pos:
Relay_Master_Log_File: mysql-bin.
Slave_IO_Running: Yes
Slave_SQL_Running: Yes
Replicate_Do_DB: xxx
Replicate_Ignore_DB:
Replicate_Do_Table:
Replicate_Ignore_Table:
Replicate_Wild_Do_Table:
Replicate_Wild_Ignore_Table:xxx
Last_Errno:
Last_Error:
Skip_Counter:
Exec_Master_Log_Pos:
Relay_Log_Space:
Until_Condition: None
Until_Log_File:
Until_Log_Pos:
Master_SSL_Allowed: No
Master_SSL_CA_File:
Master_SSL_CA_Path:
Master_SSL_Cert:
Master_SSL_Cipher:
Master_SSL_Key:
Seconds_Behind_Master:
Master_SSL_Verify_Server_Cert: No
Last_IO_Errno:
Last_IO_Error:
Last_SQL_Errno:
Last_SQL_Error:
Replicate_Ignore_Server_Ids:
Master_Server_Id: xxx
Master_UUID: xxx
Master_Info_File: /data02/mysql/master.info
SQL_Delay:
SQL_Remaining_Delay: NULL
Slave_SQL_Running_State: System lock
Master_Retry_Count:
Master_Bind:
Last_IO_Error_Timestamp:
Last_SQL_Error_Timestamp:
Master_SSL_Crl:
Master_SSL_Crlpath:
Retrieved_Gtid_Set: xxx
Executed_Gtid_Set: GTID值
Auto_Position:
row in set (0.45 sec)

解决MySQL数据库同步1236错误的更多相关文章

  1. 使用图形界面管理工具Navicat for MySQL连接Mysql数据库时提示错误:Can't connect to MySQL server (10060)

    版权声明:本文为 testcs_dn(微wx笑) 原创文章,非商用自由转载-保持署名-注明出处,谢谢. https://blog.csdn.net/testcs_dn/article/details/ ...

  2. 如何解决mysql数据库X小时无连接自动关闭

    windows下打开my.ini,增加: interactive_timeout=28800000 wait_timeout=28800000 专家解答:MySQL是一个小型关系型数据库管理系统,由于 ...

  3. mysql数据库同步

    mysql数据库同步  1.1. Master 设置步骤 配置 my.cnf 文件 确保主服务器主机上my.cnf文件的[mysqld]部分包括一个log-bin选项.该部分还应有一个server-i ...

  4. 如何解决mysql数据库8小时无连接自动关闭

    windows下打开my.ini,增加: interactive_timeout=28800000 wait_timeout=28800000 专家解答:MySQL是一个小型关系型数据库管理系统,由于 ...

  5. (转载)解决MySql 数据库 提示:1045 access denied for user 'root'@'localhost' using password yes

    今天想用用MySQL 数据库  谁知道老提示 1045 access denied for user 'root'@'localhost' using password yes 最后在csdn 上找到 ...

  6. mysql数据库,编码错误解决

    在写代码的过程中,经常会遇见,将中文字符输入到mysql数据库中,但是查看的时候,却发现,中文显示为乱码的情况,让人相当的头疼,今天正好解决了一个这样遇到的问题,所以简单总结一下: 1.首先查看数据库 ...

  7. 实现两个Mysql数据库同步

    一.     概述  MySQL从3.23.15版本以后提供数据库复制(replication)功能,利用该功能可以实现两个数据库同步.主从模式.互相备份模式的功能.本文档主要阐述了如何在linux系 ...

  8. 项目--解决MySQL数据库插入中文乱码

    转载自:http://blog.csdn.net/zzh920625/article/details/51226312 情景再现] 如图,在项目中使用MySQL数据库,在做插入操作时,写入英文字符没有 ...

  9. MySQL数据库同步工具的设计与实现

    一.背景 在测试过程中,对于不同的测试团队,出于不同的测试目的,我们可能会有多套测试环境.在产品版本迭代过程中,根据业务需求,会对数据库的结构进行一些修改,如:新增表.字段.索引,修改表.字段索引等操 ...

随机推荐

  1. linux - camera capture

    //cut a picture#include <stdio.h>#include <stdlib.h>#include <string.h>#include &l ...

  2. linux进程同步机制_转

    转自:Linux进程同步机制 具体应用可参考:线程同步       IPC之信号量 为了能够有效的控制多个进程之间的沟通过程,保证沟通过程的有序和和谐,OS必须提供一 定的同步机制保证进程之间不会自说 ...

  3. RabbitMQ之路由(Routing)【译】

    在上一节中,我们创建了一个简单的日志系统,可以广播消息到很多接收者. 这一节,我们将在上一节的基础上加一个功能--订阅部分消息.例如,我们只将严重错误信息写入到日志文件保存在磁盘上,同时我们能将所有的 ...

  4. SQL合并数据

    --CREATE TABLE TMaterial (PMaterial INT,FName NVARCHAR(32))--INSERT INTO TMaterial--SELECT 1,'A' UNI ...

  5. 树莓派系统Raspbian安装小结

    是有界面的系统. NOOBS, our easy installer for Raspbian  基于debian NOOBS stands for New Out Of Box Software h ...

  6. javascript弹出层-DEMO001

    首先上一张图 看下弹出层的效果 从图中可以看到二部分 一是弹出层 二是遮照层 弹出层:即弹出你要操作的内容 遮照层:遮照住不要操作的内空 实际技术原理主要是 CSS +JS  (z-index是核心) ...

  7. No mysqld or mysql.server after mariadb-server install

    To start MariaDB on Fedora 20, execute the following command: systemctl start mariadb.service To aut ...

  8. RabbitMQ之Queues-5

    工作队列的主要任务是:避免立刻执行资源密集型任务,然后必须等待其完成.相反地,我们进行任务调度:我们把任务封装为消息发送给队列.工作进行在后台运行并不断的从队列中取出任务然后执行.当你运行了多个工作进 ...

  9. Unity中用触摸控制物体旋转和放大

    using UnityEngine;using System.Collections;using System.IO; public class ScaleAndRotate : MonoBehavi ...

  10. DBA面试题及解答

    一:SQL tuning 类 1:列举几种表连接方式答:merge join,hash join,nested loop Hash join散列连接是CBO 做大数据集连接时的常用方式,优化器使用两个 ...