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