MySQL master-slave database configuration

Source: Internet
Author: User

Main:
Configure my.conf
Log-bin=mysql-bin
Server-id = 1
Binlog-do-db=jinrimingpin_com
Binlog-do-db=jinripinpai_com
Binlog-do-db=jinritemaihui_com
Binlog-do-db=mingpintejia_com
BINLOG-DO-DB is a database that allows synchronization. One line.
Show MASTER STATUS
mysql-bin.000001 4658 The following settings from the library to use the change master to
Then guide the data to the library.
Create a new account that you can access from the library.
Grant replication slave on *.* to "Congku" @ "xxxx" identified by "password";
Flush privileges;
From:
Configure my.conf
Server-id = 2
Replicate-do-db=mingpintejia_com
Slave_skip_errors = 1062,1032
Database to be synchronized from the library replicate-do-db
Mysql-u congku-p-H XX.XX.XX.XX detects whether the primary server can be connected
Slave stop;
Change MASTER to
master_host= ' xxx ', master_user= ' Congku ', master_password= ' password ', master_log_file= ' mysql-bin.000002′,master_log_pos= 102470;
Start slave;
Ensure:
Slave_io_running:yes
Slave_sql_running:yes

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.