Girish Rao
Girish Rao

Reputation: 2669

Does running mysqldump modify the binary logs?

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.

Upvotes: 0

Views: 813

Answers (1)

dabest1
dabest1

Reputation: 2502

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:

mysqlbinlog --start-position=1234 binlog.0000003

This should show you the changes that were applied after certain position in a binary log.

Upvotes: 1

Related Questions