Public configuration:
Running the database service
There must be a library on the primary database server from the database server, and the table structure must be consistent.
Turn off iptables disable SELinux
Configure a host master data server:
1 master must enable Binlog log; Log-bin
2 designation of his own Server-id; server-id=5
3 Authorized connection user, can connect themselves from the main, connect themselves and then copy the data permissions; mysal > Grant Replication Slave on * * to [email protected] "192.168.2.200" identified By "123456";
Mysql> Show master status; #查看主数据库服务器当前正在使用的binlog日志名
Configuration from doing from the server:
1 Test whether the authorized user is valid;
mysql-h192.168.2.200-uliang-p123456
2 configuration from the Server-id; server-id=205 Restart Service (can not enable Binlog log from above)
3 in own native use own database administrator to log in, set oneself do 192.168.2.1 from the database server
Change Master to master_host= "192.168.2.1", master_user= "Liang", master_password= "123456", master_log_file= " X-bin.0000001 ", master_log_pos=329;
4 mysql> start slave;
Mysql> show slave status shows empty set (0.07 sec) on viewing its current status from
Slave_io_running:yes
Slave_sql_running:yes two configurations show Yes configuration complete
This article is from "Linux Cloud Computing" blog, reprint please contact the author!
MySQL Master-Slave synchronization