Configure the Mysql Master/Slave service implementation instance,
Configure the Mysql Master/Slave service implementation instance
### Configure the primary database my. cnf
server-id=1log-bin=master-binlog-bin-index=master-bin.index
### Create a synchronization account on the primary database
create user backup;GRANT REPLICATION SLAVE ON *.* TO 'backup'@'192.168.%.%' IDENTIFIED BY 'mysql';
### Configure the slave database my. cnf
server-id=2relay-log-index=slave-relay-bin.indexrelay- log=slave-relay-bin
### Restart the mysql Service
service mysqld restart
### Connect to the Master service
change master to master_host='192.168.91.128',master_port=3306,master_user='backup',master_password='mysql',master_log_file='master-bin.000001',master_log_pos=0;
### Start the slave Service
start slave;
### View Master service status
SHOW MASTER STATUS;
### View the Slave service status
SHOW slave STATUS \G;
### Check whether server_id is the same and need to be different
show variables like 'server_id';
Common Errors
Error: Fatal error: The slave I/O thread stops because master and slave have equal MySQL server UUIDs; these UIDs must be different for replication to work.
Solution:Check whether server-uuid = ****************************** in auto. cnf in the data directory is the same.
Thank you for reading this article. I hope it will help you. Thank you for your support for this site!