MySQL Replication (a): Basic Steps for replication

Source: Internet
Author: User

From here, start with a detailed description of the copied content, copying from simple to introductory

The simplest mode of replication is as follows

Basic three simple steps

1 Configure a server for Master2 to configure a server for Slave3 to connect slave to master

First, configure the master

Requires configuration in three directions: binary log and unique server ID and authorization

Binary log: Record server changes

Server ID: Server ID distinguishes server uniqueness

The specific parameters involved are

Log-bin = Master-binlog-bin-index =  Master-bin.indexserver-id = 1

Note: If not specified, the default file name is determined by the hostname

After modifying the configuration file, you need to restart the DB

SQL>Grantreplicationon  *.  * to [e-mail protected]'10.11.30.%'by'xyzzy  '; SQL>privileges;

Second, the configuration slave

As with master, you need to configure Server-id,relay-log,relay-log-index

Server-id = 2relay-log-index = Slave-relay-bin.indexrelay-log = Slave-relay-bin

Note: If not specified, the default file name depends on hostname (a pit with the default value, and if the hostname is changed, the trunk log will not be able to locate the relay log index file and the replication fails)

Third, connect master and slave

Synchronize the replication with change master to, and then start copying the start slave when finished;

 to = ' 10.11.30.69 ' =  3306 = 'repl_user'
Master_password='xyzzy';
Slave>start SLAVE;

MySQL Replication (a): Basic Steps for replication

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.