Construction of the CentOS server MySQL master-slave replication cluster

Source: Internet
Author: User

Environment: CentOS6.3 Database mysql6.5.26

Edit/ETC/MY.CNF

Vi/etc/my.cnf

Restart MySQL

Service mysqld Restart

Create user ' Mastj ' @ ' 192.168.1.16 ' identified by ' 123456 ';

Grant Replication Slave on * * to ' mastj ' @ ' 118.123.199.12 ' identified by ' 123456 ';

Show master status;

+------------------+----------+--------------+------------------+-------------------+
| File | Position | binlog_do_db | binlog_ignore_db | Executed_gtid_set |
+------------------+----------+--------------+------------------+-------------------+
| mysql-bin.000001 | 585 | | MySQL | |
+------------------+----------+--------------+------------------+-------------------+
1 row in Set (0.00 sec)

Remember mysql-bin.000001 and 5,852 parameters, this will be set from the server.

Master database Configuration Complete

From server configuration

Vi/etc/my.cnf

Only need to be in [mysqld]

Add a server-id=2 below

Then restart the MySQL service

Service mysqld Restart

Construction of the CentOS server MySQL master-slave replication cluster

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.