Install MySQL configuration master-slave synchronization under CentOS

Source: Internet
Author: User

Step 1:

Suppose 192.168.20.52 is the main library. 192.168.20.53 is the main library.

Variable section 192.168.20 account name based on your IP settings, p4ssword password repl

Where is it executed? Login MySQL Execution

GRANT REPLICATION slave,reload,super On * * to [e-mail protected] ' 192.168.20.% ' identified by ' P4ssword ';

Step 2

Vim/etc/my.cnf
Add the following configuration

Log_bin=mysql-bin
server_id=10

Step 3:

Modify from library configuration

Vim/etc/my.cnf

Log_bin=mysql-bin
server_id=2
Relay_log=/var/lib/mysql/mysql-relay-bin
Log_slave_updates=1

Step 3:

Change Master to master_host= ' 192.168.20.52 ', master_user= ' repl ', master_password= ' P4ssword ',

Master_log_file= ' mysql-bin.000001 ', master_log_pos=0;

Execute from library, view status

Show Slave Status\g

Start Replication from library
Start slave;

OK now in the main library, create a test test table, you will find in from the library, there will also be created tables and inserted data
If it is a newly installed MySQL, follow the steps above and there will be no problem with the

Before I met a slave_io_running, why did you do it for a few days?
After reloading the MySQL, now finally can.

Install MySQL configuration master-slave synchronization under CentOS

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.