mysql主从复制问题之主从两端binlog日志不同步解决方案
主操作:
- 进入主的数据库查看状态:
mysql> show master statusG;
*************************** 1. row ***************************
File: mysql-bin.000001
Position: 604
Binlog_Do_DB:
Binlog_Ignore_DB:
1 row in set (0.01 sec)
从操作:
- 进入从的数据库查看状态:
mysql> show slave statusG;
*************************** 1. row ***************************
Slave_IO_State:
Master_Host: 192.168.1.187
Master_User: slave001
Master_Port: 3306
Connect_Retry: 60
Master_Log_File: mysql-bin.000001
Read_Master_Log_Pos: 800
Relay_Log_File: mysqld-relay-bin.000001
Relay_Log_Pos: 4
Relay_Master_Log_File: mysql-bin.000001
Slave_IO_Running: No
Slave_SQL_Running: Yes
Replicate_Do_DB:
Replicate_Ignore_DB:
Replicate_Do_Table:
Replicate_Ignore_Table:
Replicate_Wild_Do_Table:
Replicate_Wild_Ignore_Table:
Last_Errno: 0
Last_Error:
Skip_Counter: 0
Exec_Master_Log_Pos: 800
Relay_Log_Space: 106
Until_Condition: None
Until_Log_File:
Until_Log_Pos: 0
Master_SSL_Allowed: No
Master_SSL_CA_File:
Master_SSL_CA_Path:
Master_SSL_Cert:
Master_SSL_Cipher:
Master_SSL_Key:
Seconds_Behind_Master: NULL
Master_SSL_Verify_Server_Cert: No
Last_IO_Errno: 1236
Last_IO_Error: Got fatal error 1236 from master when reading data from binary log: 'Client requested master to start replication from impossible position'
Last_SQL_Errno: 0
Last_SQL_Error:
1 row in set (0.00 sec)
会发现从状态与主状态不一样(主要观察Master_Log_File和Read_Master_Log_Pos),就是binlog日志不同步
- 现在需要使主从的数据先同步,然后再使binlog日志同步方能解决问题
(1).把主数据库停止更新,查看binlog(file和positon),打包放到从服务器上恢复
(2).停止从的slave,修改binlog(依据查看主的file和position),然后启动slave,最后把主的锁解除
具体操作已在《mysql主从同步配置》中做详细说明,可前往查看
mysql主从复制问题之主从两端binlog日志不同步解决方案的更多相关文章
- mysql主从复制——双机互为主从
第一.mysql主从复制(一主一从)怎么安装mysql数据库,这里不说了,只说它的主从复制,步骤如下:首先需要做一些清理工作,如果之前配置了主从,但是配置失败了.结果会在/var/lib/mysql/ ...
- MySQL的undo/redo日志和binlog日志,以及2PC
发现自己的知识点有点散,今天就把它们连接起来,好好总结一下. 一.undo log.redo log.binlog的定义和对比 定义和作用 所在架构层级 ...
- MySQL 5.6 新参数对binlog日志量的优化
数据库版本:5.6.* 1.row日志image类型 参数binlog_row_image 控制着这种image类型,默认为FULL(log all columns),即记录before&af ...
- 转载:阿里canal实现mysql binlog日志解析同步redis
from: http://www.cnblogs.com/duanxz/p/5062833.html 背景 早期,阿里巴巴B2B公司因为存在杭州和美国双机房部署,存在跨机房同步的业务需求.不过早期的数 ...
- Mysql数据库之Binlog日志使用总结
binlog二进制日志对于mysql数据库的重要性有多大,在此就不多说了.下面根据本人的日常操作经历,并结合网上参考资料,对binlog日志使用做一梳理: 一.binlog日志介绍1)什么是binlo ...
- (转)Mysql数据库之Binlog日志使用总结
使用mysqlbinlog提取二进制日志 原文:http://blog.csdn.net/leshami/article/details/41962243 MySQL binlog日志记录了MySQL ...
- Database基础(五):使用binlog日志、XtraBackup备份工具、MySQL AB复制
一.使用binlog日志 目标: 利用binlog恢复库表,要求如下: 启用binlog日志 创建db1库tb1表,插入3条记录 删除tb1表中刚插入的3条记录 使用mysqlbinlog恢复删除的3 ...
- mysql主从之binlog日志
mysql的binlog说明 主从复制依赖于二进制日志文件,简称为binlog binlog里面有存放了偏移信息 mysql主库binlog信息查看命令 [root@master ~]# mysql ...
- Mysql Binlog日志详解
一.Mysql Binlog格式介绍 Mysql binlog日志有三种格式,分别为Statement,MiXED,以及ROW! 1.Statement:每一条会修改数据的sql都会记录在 ...
随机推荐
- 识别有效的IP地址和掩码并进行分类统
#include<iostream> #include<stdio.h> #include<string.h> using namespace std; int c ...
- Load Runner11录制脚本出现乱码的解决方法
方法一: 1.录制的脚本出现乱码 Go to Vugen -> Tools -> Recording Options -> Advancedb) Check the option ...
- html5的spellcheck属性(拼写、文法检查)
<!DOCTYPE html> <html> <head> <meta charset="utf-8" /> <title&g ...
- three.js
webgl,three.js交流的论坛,欢迎到里面提问问题 www.webglchina.cn
- Servlet实现文件,图片等的下载 含代码
实现文件的下载源代码如下: package com.fxl.servlet; import java.io.FileInputStream;import java.io.IOException;imp ...
- iOS开发UI篇—九宫格坐标计算
iOS开发UI篇—九宫格坐标计算 一.要求 完成下面的布局 二.分析 寻找左边的规律,每一个uiview的x坐标和y坐标. 三.实现思路 (1)明确每一块用得是什么view (2)明确每个view之间 ...
- cloud theory is a failure? 分类: Cloud Computing 2013-12-26 06:52 269人阅读 评论(0) 收藏
since LTE came out, with thin client cloud computing and broadband communication clouding 不攻自破了.but ...
- 反向Ajax,实现服务器向客户端推送消息之 Comet
基于 HTTP 长连接.无须在浏览器端安装插件的“服务器推”技术为“Comet”. 下面将介绍两种 Comet 应用的实现模型. 基于 AJAX 的长轮询(long-polling)方式 AJAX 的 ...
- 【转】解决编译安装NGINX时make报错
编译参数:--[root@localhostnginx-1.4.6]#./configure--user=nginx--group=nginx--prefix=/usr/local/nginx--wi ...
- Android M新特性之APP Link
The Android M Developer Preview introduces support for App Links, which improves upon existing link ...