运行 mysqldump 会修改二进制日志吗?
我已经阅读了类似问题的答案,但我认为他们没有回答我的具体问题,如果我在这里重复,很抱歉。
我正在主服务器和从服务器(均为 MyISAM)之间设置现有数据的复制。我有一个主数据库,它会在白天写入,但不会在夜间写入(即不是现在)。正如 dev.mysql.com 站点上所解释的,我首先在主服务器上运行 FLUSH TABLES WITH READ LOCK 并使用 SHOW MASTER STATUS 获取二进制日志位置。
在另一个会话中,我在主服务器上运行 mysqldump 以便将此数据复制到从服务器。我使用 --lock-all-tables 选项运行 mysqldump。
然而,运行mysqldump后,我再次检查master状态,二进制日志位置增加了大约30。自从mysqldump完成以来,它还没有上移。
这是由于 mysqldump 造成的吗?还是锁没有生效,需要重新复制主数据?
如果我重复了一个问题,再次抱歉!谢谢。
I've read the answers to similar questions, but I don't think they answer my specific question, sorry if I am repeating here.
I am setting up replication with existing data between a master and a slave, both MyISAM. I have a master database that gets written to during the day but not overnight (ie, not now). As explained on the dev.mysql.com site, I first ran FLUSH TABLES WITH READ LOCK on the master and obtained the binary log position using SHOW MASTER STATUS.
In another session, I then ran mysqldump on the master in order to copy this data to the slave. I ran mysqldump with the --lock-all-tables option.
However, after running mysqldump, I checked the master status again and the binary log position had increased by about 30. It has not moved up since the mysqldump finished.
Is this increase due to the mysqldump? Or did the lock not take affect and I need to re-dumo the master data?
Again, apologies if I'm repeating a question! Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
Mysqldump 不应导致二进制日志位置发生更改。
您需要调查它发生变化的原因。查看二进制日志内部以了解写入的内容。为此,请使用 mysqlbinlog 命令。
例如,如果您在 binlog.0000003 中将初始位置记录为 1234,则执行:
这应该显示二进制日志中特定位置之后应用的更改。
Mysqldump should not cause the binary log position to change.
You need to investigate why it changed. Look inside the binary logs to get an idea of what was written to it. Use mysqlbinlog command for this.
For example if you recorded the initial position as 1234 in binlog.0000003, then execute:
This should show you the changes that were applied after certain position in a binary log.