Project Environment:
All systems are cent OS 5.5
Master Server IP Address: 192.168.19.172 (master)
Slave Server IP: 192.168.19.168 (slave)
Both of them have set up mysql (the root user and password are empty)
1: Set synchronization master and modify the mysql master configuration file:
Server-id = 1
Log-bin
Set-variable = binlog-ignore-db = mysql
2: Then add an account on the Master for synchronization, as shown below:
Grant replication slave on *. * TO rep@192.168.19.168 identified by rep;
3: query the status of the primary database (master)
Show master status;
Note:
Record the file and position Parameters on the master server
4. Configure slave server slave and modify the configuration file
Modify my. cnf and add the following lines:
Server-id = 2
Master-user = rep
Master-password = rep
Master-port = 3306
5: Configure command items,
6: start slave; the replication function is enabled.
7: view the synchronization status,
Note:
Slave_IO_Running: Yes and Slave_ SQL _Running: Yes if the two statuses are not yes, check whether the above configuration is correct, mainly because the file and position settings are correct, and whether the slave database can log in with the account of the master database