MySQL Configuration master-Slave

Source: Internet
Author: User

1, add in master server My.ini:
Server-id=1//A unique identifier for the database service, usually set the end number of the server IP
Log-bin=master-bin
Log-bin-index=master-bin.index
2, start the primary server;
3, perform the show master status, and view the state of the primary server;
4, copy the database contents of the current master server;
5, create the master server database from the server;
6, add from server My.ini:
server-id=2
Relay-log-index=slave-relay-bin.index
Relay-log=slave-relay-bin
7, start from the server;
8, executing from the service:
Change Master to master_host= ' 127.0.0.1 ',//master server IP
master_port=3306,
Master_user= ' Root ',
Master_password= ' admin ',
Master_log_file= ' master-bin.000001 ',//master server-generated logs
master_log_pos=0;
9, start from service: Start slave;
10, add a piece of data to the master server to see if the synchronization is successful from the server;

MySQL Configuration master-Slave

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.