This article mainly introduces the relevant information for configuring Mysql master-slave service implementation examples. Friends who need it can refer to it. I hope it can help everyone.
Configure Mysql master-slave service implementation instance
Configure the master database my.cnf
server-id=1 log-bin=master-bin log-bin-index=master-bin.index
create user backup; GRANT REPLICATION SLAVE ON *.* TO 'backup'@'192.168.%.%' IDENTIFIED BY 'mysql';
Configure the slave database my.cnf
server-id=2 relay-log-index=slave-relay-bin.index relay- log=slave-relay-bin
Restart the mysql service
service mysqld restart
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 slave service
start slave;
Check Master service status
SHOW MASTER STATUS;
SHOW slave STATUS \G;
show variables like 'server_id';
Common Errors
Error:
Check the server-uuid in auto.cnf in the data directory =******************** Whether they are the same, change it to differentRelated recommendations:
Mysql master-slave server architecture configuration
#########Mysql master-slave server configuration special issues############MySQL database configuration master-slave server to achieve dual-machine hot backup Example tutorial######The above is the detailed content of Configure Mysql master-slave service instance. For more information, please follow other related articles on the PHP Chinese website!