I am trying to do mysql replication. But I want to while the backup is being uploaded to the slave server, the changes in the master are not received. For example:
I have a user table on my X db. And 1000 user records.
When I run:
mysqldump -u root -p --all-databases --master-data=2 --single-transaction --flush-logs --delete-master-logs --triggers --routines --events > master_data.sql
master_data.sql is have 1000 user records.
Then I added 200 user record my master db. Now my Master DB has 1200 user records, but my backup has 1000 records.
When I run:
mysql -u root -p < /path/to/master_data.sql
Result: MY slave DB has 1000 record. MY master DB has 1200 record. What can I do.
my.cnf of the Slave DB
my.cnf of the Master DB
mysqldump
is not database replication. Replication is a configuration where the slaves automatically pull changes from the master.