[MySQL replication] quick setup of mysql databases below 20 GB _ MySQL

Source: Internet
Author: User
[MySQL replication] quick setup of mysql databases below 20 GB Because the data capacity is smaller than 20 GB, using mysqldump for full-database export has little impact on the business. Therefore, this mode is used to build a slave database:

PS: master-data = 1, record the Master_Log_File and Read_Master_Log_Pos:

1 backup the backup SQL log
/Usr/local/mysql/bin/mysqldump-uroot-p-S/usr/local/mysql. sock -- default-character-set = utf8 -- extended-insert = false -- triggers-R -- hex-blob -- all-databases -- master-data = 1 -- flush-logs>/tmp create-master2-20140416. SQL
2 scp the SQL log to the slave from master
Create-master2-20140409. SQL scp 10. xx.3.x2:/tmp/
3 create the replication account in master db servers.
Grant replication slave on *. * TO 'repl' @ '%' identified by 'XX @ xx ';
4 import the SQL to slave
/Usr/local/mysql/bin/mysql-uroot-p-S/usr/local/mysql. sock -- default-character-set = utf8 </tmp/
5 reset the replication slave status
Find the master binlog position of slave from backup SQL log file.
Change master to master_user = 'repl', master_password = 'plcc0805 @ replicationm2 ', master_host = '10. xx.3.x1 ', master_port = 3306, master_log_file = 'MySQL-bin.008713', master_log_pos = 120;

6. start slave.

Start slave;

Show slave status/G

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.