只有在主库上执行才能有效抵输出:

具体文档如下:

# 在127.0.0.:3306主库上执行

tmp@127.0.0.1 ((none))> show variables like '%server%';
+---------------------------------+--------------------------------------+
| Variable_name | Value |
+---------------------------------+--------------------------------------+
| character_set_server | utf8mb4 |
| collation_server | utf8mb4_general_ci |
| innodb_ft_server_stopword_table | |
| server_id | |
| server_id_bits | |
| server_uuid | ceabbacf-0c77-11ea-b49f-2016d8c96b46 |
+---------------------------------+--------------------------------------+
rows in set (0.01 sec)
# 根据show variables like '%server_uuid%';
# 可以获得当前mysql实例的server_uuid值 tmp@127.0.0.1 ((none))> show master status\G;
*************************** . row ***************************
File: mysql-bin.
Position:
Binlog_Do_DB:
Binlog_Ignore_DB:
Executed_Gtid_Set: 108cc4a4-0d40-11ea--2016d8c96b66:-,
c42216ad-0d37-11ea-b163-2016d8c96b56:-,
ceabbacf-0c77-11ea-b49f-2016d8c96b46:-
row in set (0.00 sec) ERROR:
No query specified tmp@127.0.0.1 ((none))> # 根据主库上执行show master status\G;
# Executed_Gtid_Set值表明:每个server_uuid代表一个实例,有多个server_uuid表明这三个实例都曾经当过主库,分别执行的事务个数都确定。在ceabbacf-0c77-11ea-b49f-2016d8c96b46实例上执行了1662590个事务,在c42216ad-0d37-11ea-b163-2016d8c96b56实例上执行了9个事务,在108cc4a4-0d40-11ea--2016d8c96b66实例上执行了5个事务,但是并不知道这些实例之间事务执行的先后顺序,当然同一个实例上的事务肯定是从1开始递增,步长为1.结合该实例上的server_uuid可知道,当前主库实例执行到了ceabbacf-0c77-11ea-b49f-2016d8c96b46:-1662590这个位置上了。 # 根据File: mysql-bin.000013和Position: 269728976可知:当前写的二进制日志文件名称和位置是mysql-bin.:,在文件mysql-bin.000013中有“end_log_pos ”的地方就是这个位置,如下就是截取了mysql-bin.000013日志最后一部分内容: # at
# :: server id end_log_pos GTID last_committed= sequence_number= rbr_only=yes
/*!50718 SET TRANSACTION ISOLATION LEVEL READ COMMITTED*//*!*/;
SET @@SESSION.GTID_NEXT= 'ceabbacf-0c77-11ea-b49f-2016d8c96b46:1662590'/*!*/;
# at
# :: server id end_log_pos Query thread_id= exec_time= error_code=
SET TIMESTAMP=/*!*/;
BEGIN
/*!*/;
# at
# :: server id end_log_pos Rows_query
# update table_name set name='' where id=
# at
# :: server id end_log_pos Table_map: `apple`.`table_name` mapped to number
# at
# :: server id end_log_pos Update_rows: table id flags: STMT_END_F
### UPDATE `apple`.`table_name`
### WHERE
### @= /* LONGINT meta=0 nullable=0 is_null=0 */
### @='' /* VARSTRING(1020) meta=1020 nullable=1 is_null=0 */
### SET
### @= /* LONGINT meta=0 nullable=0 is_null=0 */
### @='' /* VARSTRING(1020) meta=1020 nullable=1 is_null=0 */
# at
# :: server id end_log_pos Xid =
COMMIT/*!*/;
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 master status的更多相关文章

  1. show master status, show slave status中的Executed_Gtid_Set

    slave 如果server是slave节点,在server上执行show master staus与show slave status显示的Executed_Gtid_Set是一样的. slave也 ...

  2. mysql show master status为空值

    问题 执行show master status,输出结果为空: mysql> show master status; Empty set (0.00 sec) 原因 mysql没有开启日志. 查 ...

  3. c.a.o.c.p.inbound.mysql.rds.RdsBinlogEventParserProxy - prepare to find start position just show master status

    2018-12-27 08:39:49.808 [destination = example , address = /127.0.0.1:3308 , EventParser] WARN c.a.o ...

  4. show master status empty解决方案

    The following MySQL error might occur if you are using MySQL replication and binary logs. mysql> ...

  5. show master/slave status求根溯源

    show master/slave status分别是查看主数据库以及副数据库的状态,是一种能查看主从复制运行情况的方式. 这里仅仅讨论linux下的nysql5.7.13版本的执行情况 一.show ...

  6. MySQL show master / slave status 命令参数

    一.show master status 二.show slave status Slave_IO_State SHOW PROCESSLIST输出的State字段的拷贝.SHOW PROCESSLI ...

  7. Windows下搭建MySQL Master Slave

    一.背景 服务器上放了很多MySQL数据库,为了安全,现在需要做Master/Slave方案,因为操作系统是Window的,所以没有办法使用keepalived这个HA工具,但是我们可以接受人工进行切 ...

  8. Slave作为其它Slave的Master时使用

    主从配置需要注意的点 (1)主从服务器操作系统版本和位数一致: (2) Master和Slave数据库的版本要一致: (3) Master和Slave数据库中的数据要一致: (4) Master开启二 ...

  9. mysql slave to master

    1, 在maste A上面创建专门用于备份的用户Bshow master statusget log_file and log_pos 2,CHANGE MASTER TO MASTER_HOST=' ...

随机推荐

  1. 其它课程中的python---3、numpy总结(非常全)

    其它课程中的python---3.numpy总结(非常全) 一.总结 一句话总结: 学习方式应该是:听课+总结:-->找总结博客+再总结 需要始终记住:凭借,继承,复用 1.numpy的主要功能 ...

  2. 在Word中如何自动生成参考文献引用

    来自:在Word中如何自动生成参考文献引用 在写毕业论文时,参考文献动辄就有四五十篇,在文中对照参考文献逐一引用是一件十分痛苦的事情,而且一旦参考文献的顺序发生变化,文中的引用也要逐个修改,那么,我们 ...

  3. python 16 文件操作(二)

    转自 http://www.cnblogs.com/BeginMan/p/3169020.html 一.文件系统 从系统角度来看,文件系统是对文件存储器空间进行组织和分配,负责文件存储并对存入的文件进 ...

  4. sql 特殊时间值 第一天或最后一天 无计算错误

    DECLARE @dt datetimeSET @dt=GETDATE() DECLARE @number intSET @number=3 --1.指定日期该年的第一天或最后一天--A. 年的第一天 ...

  5. java oop第09章_JDBC02(CRUD操作)

    第09章_JDBC02(CRUD操作) CRUD(CREATE . RETIVE . UPDATE . DELETE)增删改查. DAO中会提供一些CRUD操作方法,调用者可以通过调用这些方法完成相应 ...

  6. c结构体指针使用

    #include <stdio.h> #include<stdlib.h> #include<string.h> typedef struct _Date { un ...

  7. Java 多线程 - Future

    Java中Future的使用场景和解析 https://blog.csdn.net/hongtaolong/article/details/83349705 (细看!!!)

  8. Windows ping

    用法: ping [-t] [-a] [-n count] [-l size] [-f] [-i TTL] [-v TOS]            [-r count] [-s count] [[-j ...

  9. 最大流拆点——hdu2732,poj3436

    一种很普遍的做法就是把一个带有容量的点拆成两个点,一个入点一个出点,链接两个点的边的权值为这个点的容量 hdu3732 #include<cstdio> #include<cstri ...

  10. c&c++MFC 调用 js 函数代码

    调用函数代码和示例   Code highlighting produced by Actipro CodeHighlighter (freeware)http://www.CodeHighlight ...