MySQL master-slave replication configuration

Source: Internet
Author: User

    1. Installing MARIADB

Yum Install-y mariadb*

2. Start MARIADB

Systemctl Start mariadb

3. Modify the MARIADB root password

Mysqladmin-u root-p Password 123456


4. Modify the master configuration

Vi/etc/my.cnf.d/server.cnf

[Mysqld]

Log-bin=mysql-bin

server-id=227//IP Address Last


5. Modify the slave configuration

Vi/etc/my.cnf.d/server.cnf

[Mysqld]

Log-bin=mysql-bin

server-id=228//IP Address Last


6. Restart MARIADB

Systemctl Restart MARIADB


7. Slave Authorized on Master

GRANT REPLICATION SLAVE on * * to ' root ' @ '% ' identified by ' 123456 ';


8. View status

Show master status;


9. Configuring the Slave server

Change MASTER to master_host= ' 10.10.101.227 ', master_user= ' root ', master_password= ' 123456 ', master_log_file= ' Mysql-bin.000001 ', master_log_pos=1110;

START SLAVE;

SHOW SLAVE Status\g

MySQL master-slave replication configuration

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.