MySQL 5.7 master and slave library replication settings

Source: Internet
Author: User

1. Create a replication user

' Rep_user ' @'%.192.168.0.106'123456';

2. Permission Grant

' Rep_user ' @'%.192.168.0.106';

3. Back up the main library

C:\users\administrator>mysqldump-uroot--password--databases test01 >e:/temp/20170507/ ****
Show master status;

View the main library status

Stop the main library service

4. Recovering data from a library

C:\temp\mysql-5.7. -winx64\bin>mysql-u root-p <c:/temp/* * * * *

5. Start Copy from library

to set up replication information from a library -. Mysql>Change MASTER to -. master_host='Master_host_name', +. Master_user='Replication_user_name', -. master_password='Replication_password', +. master_log_file='Recorded_log_file_name', A. master_log_pos=recorded_log_position start SLAVE from the library thread ;
Use the following command to view the copy status from library show slave status;

MySQL 5.7 master and slave library replication settings

Related Article

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.