Transferred from: http://www.cnblogs.com/it-cen/p/4600568.html
Not much to say, direct operation + picture.
Primary server (192.168.1.111) configuration:
1, to set up authorized users from the server 2, modify the master server Profile MY.COF, open the Bin-log log, and set the Server-id value (each server-id is not the same) 3, set the read lock on the primary server is valid, ensure that there is no database operation, In order to obtain a one-time snapshot 4, to view the current binary log name and offset 5 on the primary server, the current primary database server has stopped the update operation, to generate a backup of the primary database, there are two methods of backup: (1), CP all data (2), mysqldump Backup data Method 6, After the primary database backup is complete, the primary database can resume write operations 7, the primary database to restore the consistent backup to the database, the above test2.sql to the corresponding directory can be configured from the server (192.168.1.112): 1, modify from the server configuration file vim/etc/ My.cnf
2, restart Mysqld Service 3, view the corresponding master-slave copy process list There are two kinds: (1), Processlist (2), status slave_io_running This process is responsible for reading Bin-log logs from the server from the primary server, and write to the trunk log from the server slave_sql_running this process is responsible for reading and performing the Binlog log configuration in the trunk log is complete Test successful!!
MySQL Master-slave replication