"Base" mysqldump create a Gtid-based slave library

Source: Internet
Author: User

For small databases, we can use the mysqldump full-Library export import directly to create from the library.


Test environment:

CentOS6.8 x86_64

MySQL5.6.34 Community RPM Edition

Main Library: Node0 192.168.2.10

From library: Node1 192.168.2.11


5.6 The parameters that must be accompanied by the Gtid copy (both the main and slave libraries are added with these 3 rows of parameters):

Gtid-mode=on

Enforce_gtid_consistency = On

Log_slave_updates=on


STEP1, export in main library and SCP to Node1:

mysqldump-uroot [email protected]-a-q--single-transaction--master-data=2 >/root/all.sql

Scp/root/all.sql node1:/root/


Step2, Node1 on the back:

Node1 New installation without password, execute MySQL to log in

Source/root/all.sql;


Step3, start replication on Node1:

Change MASTER to master_host= ' 192.168.2.10 ',

Master_user= ' RPL ',

Master_password= ' RPL ',

master_port=3306,

Master_auto_position=1;


Start slave;

Show Slave Status\g



Description

Mysqldump this way of importing does not need to execute set global gtid_purged= ' xxxxx ' like innobackup; This type of operation. Because there are automatic settings in the mysqldump exported SQL, this is the part of the exported all.sql:

650) this.width=650; "src=" Https://s3.51cto.com/wyfs02/M02/93/14/wKioL1kIASGDEYXJAAB3cQ3YHXo778.png "title=" QQ Pinyin is not named. png "alt=" Wkiol1kiasgdeyxjaab3cq3yhxo778.png "/>


"Base" mysqldump create a Gtid-based slave library

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.