Configure Mysql master-slave service implementation example ### Configure the main database my.cnf server-id=1 log-bin=master-bin log-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=2 relay-log-index=slave-relay-bin.index relay-log=slave-relay-bin ### Restart 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; ### Check the Master service status SHOW MASTER STATUS; ### Check the Slave service status SHOW slave STATUS \G; ### Check if server_id is the same, it needs to be different show variables like 'server_id'; Common Mistakes Error: Fatal error : The slave I/O thread stops because master and slave have equal MySQL server UUIDs; these UUIDs must be different for replication to work. Solution: Check if server-uuid=******************** in auto.cnf in the data directory is the same, change it to different Thank you for reading, I hope it can help you, thank you for your support of this site! You may also be interested in:
|
<<: js to implement the snake game with comments
>>: How to build a new image based on an existing image in Docker
Preface In our daily work, we often need to renam...
Log in docker login Complete the registration and...
Preface [root@localhost ~]# cat /etc/fstab # # /e...
When the img src value is empty, two requests are ...
1 What is BEM Naming Standard Bem is the abbrevia...
Including the use of check boxes and radio buttons...
Table of contents Basic Types any type Arrays Tup...
Table of contents Install jupyter Docker port map...
1. Download the required packages wget -P /usr/lo...
Recently, I came across a webpage that had images ...
By default, the table title is horizontally cente...
Equal height layout Refers to the layout of child...
This article example shares the specific code of ...
A mature database architecture is not designed wi...
This article uses an example to describe how to q...