0

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 Slave DB

my.cnf of the Master DB

my.cnf of the Master DB

5
  • 1
    mysqldump is not database replication. Replication is a configuration where the slaves automatically pull changes from the master.
    – Barmar
    Commented Jul 12 at 20:02
  • if you're using mysqldump to replicate data manually, you have to run it again after you make changes on the master. Nothing automatically updates the dump file.
    – Barmar
    Commented Jul 12 at 20:04
  • Actually ı want to ask this question: How can I do realtime replication? But without START SLAVE;
    – İbrahim Gunes
    Commented Jul 12 at 20:07
  • Database Administrators is the correct place to ask about database configuration.
    – Barmar
    Commented Jul 12 at 20:11
  • START REPLICA is not START SLAVE, but they are synonyms for the same action. You must use one or the other of these statements to start replication. Commented Jul 12 at 20:41

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.