MySQL 5.6 -- dump-slave parameter usage

Source: Internet
Author: User

MySQL 5.6 -- dump-slave parameter usage

In MySQL 5.5 and later versions, a parameter "dump-slave" is added. With this parameter, we can export data on the slave node to create a new slave to avoid pressure on the master database.

The method is as follows:
Run the command on slave;
1. view the current synchronization status
# Show slave status \ G focuses on the following:

Master_Log_File: mysql-bin.000095

Read_Master_Log_Pos: 50607116
Relay_Master_Log_File: mysql-bin.000095
Exec_Master_Log_Pos: 50607116

2. Export data on slave as follows:
# Mysqldump-uroot-proot -- single-transaction -- dump-slave = 2-A> all. SQL

3. View Exported Files

# Head-30 all. SQL can see fields similar to the following:

-- Change master to MASTER_LOG_FILE = 'mysql-bin.000095 ', MASTER_LOG_POS = 50607116;

In this case, we will take the exported data and restore it to a new slave. Execute:

> CHANGE MASTER
MASTER_HOST = 'master _ ip ',
MASTER_USER = 'replace user ',
MASTER_PASSWORD = '000000 ',
MASTER_PORT = 3306,
MASTER_LOG_FILE = 'mysql-bin.000095 ',
MASTER_LOG_POS = 50607116,
MASTER_CONNECT_RETRY = 10;

> Start slave; you can start replication on the new slave.

This article permanently updates the link address:

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.