MySQL master-Slave Synchronization Deployment Summary

Source: Internet
Author: User

Operating Environment

Main: 192.168.1.124

From: 192.168.1.125

Mysql-5.0.56.tar.gz, centos5.2

Database 1:/data/3306/Database 2:/data/3307/

1, modify the main library my.cnf

============================

# VI/ETC/MY.CNF

Server-id = 1

Log-bin

============================

2, restart the main library effective

=======================

#/data/3306/mysql stop

#/data/3306/mysql start

=======================

3, landing the main library

================================

#mysql-uroot-p-s/data/3306/mysql.sock

================================

4, given from the library permissions account, allowing users in the main Library load table and load DATA

====================================================================

Mysql> GRANT file,select,replication SLAVE on *.* to repl@192.168.1.125 identified by ' 123456 ';

====================================================================

5, check whether the success of the creation

====================================================================

Select User,host from Mysql.user;

================================================

6, lock the main library table

===========================

Mysql> FLUSH TABLES with READ LOCK;

===========================

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.