MySQL Master-slave replication

Source: Internet
Author: User
Tags log log

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

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.