MySQL Master-Slave synchronization

Source: Internet
Author: User

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

Contact Us

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.