How to sync MySQL db between master and slave?

How to sync MySQL db between master and slave?

Export the master (in screen) using compression and automatically capturing the correct binary log coordinates: Copy the replication.sql.gz file to the slave and then import it with zcat to the instance of MySQL running on the slave: Start replication by issuing the command to the slave:

How to re-sync if master and slave have?

Assume the master is 192.168.100.50 and the slave is 192.168.100.51, each server has a distinct server-id configured, the master has binary logging on and the slave has read-only=1 in my.cnf To stage the slave to be able to start replication just after importing the dump, issue a CHANGE MASTER command but omit the log file name and position:

How often do MySQL threads connect to their master?

Slave thread in the MySQL retries to connect to its master after every 60 sec by default. This property can be changed as MySQL ha a flag “master_connect_retry=5” where 5 is in sec. This means that we want a retry after every 5 sec.

How to release the read lock in MySQL?

Without closing the connection to the client (because it would release the read lock) issue the command to get a dump of the master: Now you can release the lock, even if the dump hasn’t ended yet. To do it, perform the following command in the MySQL client:

How often does this log into MySQL only once?

This logs into mysql only once. @RolandoMySQLDBA has given an excellent and accurate answer to the question you asked, but you didn’t give the full context of what you’re trying to do. Reading between the lines of your other recent questions, it seems that you will try to correlate this to a backup for point-in-time recovery.

How can I retrieve the log position and log file?

How can I retrieve the log position and log file. This logs into mysql only once. @RolandoMySQLDBA has given an excellent and accurate answer to the question you asked, but you didn’t give the full context of what you’re trying to do.

What to do when MySQL is stopped on a slave?

Verify that the slave mysql is STOPPED. Copy the dumps and the archives of the databases you made in previous steps on the master to the slave. Replace the datafiles of the MyISAM databases you got from the master.

How to reset MySQL master to slave replication?

Login to the MySQL server and execute the following command. After stopping slave go to master server and reset the master state using following command. [ Note: Adding a read lock with production sites. Read more about table locking ] Take a dump of database is being replicated using following command.