首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >5.7.14上的mysql.gtid_executed表为空,而@@global.gtid_executed不是

5.7.14上的mysql.gtid_executed表为空,而@@global.gtid_executed不是
EN

Stack Overflow用户
提问于 2017-04-16 11:04:23
回答 1查看 291关注 0票数 0

从MySQL 5.7.6开始,mysql.gtid_executed应该跟踪所有执行的gtids。

然而,在MySQL 5.7.14中,我看到了如下场景

代码语言:javascript
运行
复制
    mysql> select @@global.gtid_executed;

+-----------------------------------------------------------------------+ | @@global.gtid_executed | +-----------------------------------------------------------------------+ | cd5cd102-6586-0742-6f26-5b4c4c17d44d:4294967296:8589934592-8589939092 | +-----------------------------------------------------------------------+

代码语言:javascript
运行
复制
    1 row in set (0.00 sec)

    mysql> select * from mysql.gtid_executed;
    Empty set (0.00 sec)

这种差异可以解释吗?

EN

回答 1

Stack Overflow用户

发布于 2021-11-01 19:19:54

根据mysql documentation

代码语言:javascript
运行
复制
If binary logging is enabled (log_bin is ON), whenever the binary log is rotated or the server is shut down, the server writes GTIDs for all transactions that were written into the previous binary log into the mysql.gtid_executed table. This situation applies on a replication source server, or a replica where binary logging is enabled.

我在mysql启动时看到了同样的行为,但是在刷新日志之后,FLUSH LOGS;可以在mysql.gtid_executed表中看到GTID范围。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/43433291

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档