MySQL master-Slave synchronization complete Command

Source: Internet
Author: User
Main Library Operations

1. Read-only lock for the master library

Flush tables with read lock;


2. Export data from the main library

Mysqldump-h120.92.20.125-u admin-p--all-databases >event-manager.sql


3. View the main library binary log information

Show Master Status Note the binary log file name and location


4. Unlocking the main library

Unlock tables



Operation from Library

1. Import data from the Event-manager.sql file of the main library

Mysql-uroot-p < Event-manager.sql


2. Go to execute from library

Mysql-uroot-p

>stop slave;

>change Master to master_host= ' 120.92.20.125 ', master_port=53895,master_user= ' Awsabroadrepl ', master_password= ' Qakcc8imkjgbhqlc ', master_log_file= ' binlog.001178 ', master_log_pos= ' 55981780 ';

>start slave;

>show slave status;


MySQL master-Slave synchronization complete Command

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.