MYSQL master/slave data synchronization configuration _ MySQL
Source: Internet
Author: User
MYSQL masterslave data synchronization configuration my test environment. basically, data is synchronized instantly. I hope to help you with redhat9.0mysql3.23.57mysql data synchronization and backup A server: 192.168.1.2 master server masterB server: 192.168.1.3 slave server slaveA server settings # mysql-uroot-pmysqlGRANTFILEO MYSQL master/slave data synchronization configuration
In my testing environment, data is basically synchronized in an instant and I hope it will be helpful to you.
Redhat 9.0
Mysql3.23.57
Mysql data synchronization backup
Server A: master server 192.168.1.2
Server B: 192.168.1.3 slave server slave
Server A settings
# Mysql-u root-p
Mysql> grant file on *. * TO backup@192.168.1.3 identified by '20140901 ';
Mysql> \ exit
In the above example, the Master opens an account backup password 1234 to the IP address: 192.168.1.3 and has the permission to process the file.
Mysqladmin-u root-p shutdown
Back up all the databases on the Master. tar commands are usually used.
In this case, the index is generated because the log-bin parameter is added. The/var/lib/mysql directory contains the. index file to record the change log of the database.
1. when both A and B networks and services are normal, the data changes from A side to B side to view data and check whether replication is performed ?!
2. simulate B as A machine, or B may not always need to be connected to.
After the data changed on the side is viewed on the B side, point B should have no data changes.
# Tar xvf/tmp/mysql-snapshot.tar
# Chown-R mysql: mysql
1. restart mysql of server B.
Master.info appears in the/var/lib/mysql directory, which records the information of the Master MySQL server.
Condition test
1. when both A and B networks and services are normal, the data changes from A side to B side to view data and check whether replication is performed ?!
2. simulate B as A machine, or B may not always need to be connected to.
After the data changed on the side is viewed on the B side, point B should have no data changes.
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.