从show slave status 中1062错误提示信息找到binlog的SQL
mysql> show slave status\G
*************************** 1. row ***************************
Slave_IO_State: Waiting for master to send event
Master_Host: 192.168.190.27
Master_User: repl
Master_Port: 3306
Connect_Retry: 60
Master_Log_File: restoredb-bin.000013
Read_Master_Log_Pos: 2637
Relay_Log_File: restoredb2-relay-bin.000010
Relay_Log_Pos: 1059
Relay_Master_Log_File: restoredb-bin.000013
Slave_IO_Running: Yes
Slave_SQL_Running: No
Replicate_Do_DB:
Replicate_Ignore_DB:
Replicate_Do_Table:
Replicate_Ignore_Table:
Replicate_Wild_Do_Table:
Replicate_Wild_Ignore_Table:
Last_Errno: 1062
Last_Error: Could not execute Write_rows event on table liangdb.t_test_02; Duplicate entry '2' for key 'PRIMARY', Error_code: 1062; handler error HA_ERR_FOUND_DUPP_KEY; the event's master log restoredb-bin.000013, end_log_pos 2606
Skip_Counter: 0
Exec_Master_Log_Pos: 2362
Relay_Log_Space: 1991
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: 0
Last_IO_Error:
Last_SQL_Errno: 1062
Last_SQL_Error: Could not execute Write_rows event on table liangdb.t_test_02; Duplicate entry '2' for key 'PRIMARY', Error_code: 1062; handler error HA_ERR_FOUND_DUPP_KEY; the event's master log restoredb-bin.000013, end_log_pos 2606
Replicate_Ignore_Server_Ids:
Master_Server_Id: 62
Master_UUID: 85f64e00-7a86-11e8-92cd-ee2079684cfe
Master_Info_File: /data/mysql/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: 180724 16:46:36
Master_SSL_Crl:
Master_SSL_Crlpath:
Retrieved_Gtid_Set:
Executed_Gtid_Set:
Auto_Position: 0
Replicate_Rewrite_DB:
Channel_Name:
Master_TLS_Version:
1 row in set (0.00 sec)
注意上面有三个信息是我们需要的:
Exec_Master_Log_Pos: 2362
master log restoredb-bin.000013
end_log_pos 2606
[root@restoredb mysql]# mysqlbinlog --base64-output="decode-rows" -v --start-position=2362 --stop-position=2606 restoredb-bin.000013 >liangguojun.log
[root@restoredb mysql]# cat liangguojun.log
/*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=1*/;
/*!50003 SET @OLD_COMPLETION_TYPE=@@COMPLETION_TYPE,COMPLETION_TYPE=0*/;
DELIMITER /*!*/;
# at 2362
#180724 16:46:46 server id 62 end_log_pos 2427 CRC32 0xe4e76605 Anonymous_GTID last_committed=sequence_number=7 rbr_only=yes
/*!50718 SET TRANSACTION ISOLATION LEVEL READ COMMITTED*//*!*/;
SET @@SESSION.GTID_NEXT= 'ANONYMOUS'/*!*/;
# at 2427
#180724 16:46:46 server id 62 end_log_pos 2502 CRC32 0xfe5c8054 Query thread_id=1261 exec_time=0 error_code=0
SET TIMESTAMP=1532422006/*!*/;
SET @@session.pseudo_thread_id=1261/*!*/;
SET @@session.foreign_key_checks=1, @@session.sql_auto_is_null=0, @@session.unique_checks=1, @@session.autocommit=1/*!*/;
SET @@session.sql_mode=268435456/*!*/;
SET @@session.auto_increment_increment=1, @@session.auto_increment_offset=1/*!*/;
/*!\C utf8 *//*!*/;
SET @@session.character_set_client=33,@@session.collation_connection=33,@@session.collation_server=33/*!*/;
SET @@session.lc_time_names=0/*!*/;
SET @@session.collation_database=DEFAULT/*!*/;
BEGIN
/*!*/;
# at 2502
#180724 16:46:46 server id 62 end_log_pos 2560 CRC32 0x63793851 Table_map: `liangdb`.`t_test_02` mapped to number 416
# at 2560
#180724 16:46:46 server id 62 end_log_pos 2606 CRC32 0xd4c25867 Write_rows: table id 416 flags: STMT_END_F
### INSERT INTO `liangdb`.`t_test_02`
### SET
### @1=2
### @2='test'
ROLLBACK /* added by mysqlbinlog */ /*!*/;
SET @@SESSION.GTID_NEXT= 'AUTOMATIC' /* added by mysqlbinlog */ /*!*/;
DELIMITER ;
# End of log file
/*!50003 SET COMPLETION_TYPE=@OLD_COMPLETION_TYPE*/;
/*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=0*/;
从show slave status 中1062错误提示信息找到binlog的SQL的更多相关文章
- 从show slave status 中判断mysql同步状态
slave status 中检查同步状态: 1.sql线程和io线程显示yes Slave_IO_Running: Yes Slave_SQL_Running: Yes 2. Master_Log_F ...
- show slave status中的log_file / log_pos
在MySQL的master-slave或dual master的架构中,我们经常使用show slave status命令来查看复制状态. 这里涉及几个重要的日志文件和位置: Master_Log_F ...
- springMVC 校验时,CustomValidationMessages.properties中的错误提示信息的中文乱码 问题
今天在学习springmvc的校验时,遇到了CustomValidationMessages.properties配置文件的信息,才错误提示时是乱码的问题:在网上找了很多方法都没解决:最后原来是在配置 ...
- show master status, show slave status中的Executed_Gtid_Set
slave 如果server是slave节点,在server上执行show master staus与show slave status显示的Executed_Gtid_Set是一样的. slave也 ...
- 两主机搭建MySQL主从复制后,show slave status显示:Last_IO_Error: error connecting to master ……
两台主机A.B搭建mysql主从复制关系(A为master,B为slave)后,在slave上执行show slave status,结果中显示Last_IO_Error: error connect ...
- [置顶] 两主机搭建MySQL主从复制后,show slave status显示:Last_IO_Error: error connecting to master ……
两台主机A.B搭建mysql主从复制关系(A为master,B为slave)后,在slave上执行show slave status,结果中显示Last_IO_Error: error connect ...
- MySQL show master / slave status 命令参数
一.show master status 二.show slave status Slave_IO_State SHOW PROCESSLIST输出的State字段的拷贝.SHOW PROCESSLI ...
- MySQL show slave status命令参数
? Slave_IO_State SHOW PROCESSLIST输出的State字段的拷贝.SHOW PROCESSLIST用于从属I/O线程.如果线程正在试图连接到主服务器,正在等待来自主服务器的 ...
- 细说show slave status参数详解(最全)【转】
在搭建好mysql主从之后,我们一般在从库上通过命令 show slave status\G 来查看主从的状态,会有很多的参数,接下来笔者就带大家好好的了解这些参数 root@localhost (n ...
随机推荐
- Vue神之大坑处理:获取通过URL的的参数不可直接操作
比如: $router.query['isZero'] == 'false'; //不会生效,刷新页面又好使了.打印处理是蓝色的false,再次刷新字体就变浅黑了. 解决:($router.quer ...
- mobx项目创建 + mobx项目流程代码
一. 安装mobx 1. react 安装并 reject抽离配置 1. 全局安装 create-react-app 这个脚手架 npm/cnpm i create-react-app -g yarn ...
- C# Aspect-Oriented Programming(AOP) 利用多种模式实现动态代理
什么是AOP(Aspect-Oriented Programming)? AOP允许开发者动态地修改静态的OO模型,构造出一个能够不断增长以满足新增需求的系统,就象现实世界中的对象会在其生命周期中不断 ...
- PatentTips - Interrupt redirection for virtual partitioning
BACKGROUND The present disclosure relates to the handling of interrupts in a environment that utiliz ...
- 阿里云部署Docker(3)----指令学习
通过上两节的学习http://blog.csdn.net/minimicall/article/details/40119177 和http://blog.csdn.net/minimicall/ar ...
- python 深浅拷贝 进阶
主要理解新与旧究竟在哪里 这样也就理解了 深浅拷贝 先说说赋值,事实上python中的赋值事实上是赋值了一个引用.比如: foo1=1.0 foo2=foo1 用操作符is推断时.你能够发现结果是tr ...
- window.location无法跳转页面的问题
最近在使用 window的location时碰到一个无法跳转页面的问题, 后来在location语句后加了一条这样的语句:window.event.returnValue = false;然后竟然可以 ...
- Fiddler抓包工具详细介绍
本文转自:http://www.cnblogs.com/Chilam007/p/6985379.html 一.Fiddler与其他抓包工具的区别 1.Firebug虽然可以抓包,但是对于分析http请 ...
- JMeter--聚合报告之 90% Line 正确理解
90% Line 参数正确的含义: 虽然,我的上面理解有一定的道理,显然它(90% 用户的响应时间)是错误的.那看看JMeter 官网是怎么说的? 90% Line - 90% of the samp ...
- Spring Boot Shiro 权限管理
Spring Boot Shiro 权限管理 标签: springshiro 2016-01-14 23:44 94587人阅读 评论(60) 收藏 举报 .embody{ padding:10px ...