MySQL database synchronization under the mainstream operating system

Source: Internet
Author: User

When the data volume of the database is frequently read and written, we should consider separating the reading and writing of the database to improve the efficiency of the database, (of course, there are other uses such as backup data), this time we need to use a MySQL function, database synchronization. The following is a detailed implementation of the method

First, the system environment

Primary Database (Master):

System: Windows

Database: MySQL 5.0.51

ip:192.168.1.156

From the database (slave):

System: Linux

Database: MySQL 5.0.67

ip:192.168.1.154

Second, configuration parameters:

The network said that the two database configuration must be consistent, but also the two configuration files to the handcuffs. It seems to make sense because some of the features are not consistent and may cause synchronization errors. But my two MySQL systems are different, so follow the default installation configuration.

Database preparation:

The database to synchronize is called account

Then you must put the account and data on the primary server to the slave server.

and open an account on the primary server that allows access from the server.

Primary database (Master) configuration:

Modify MySQL configuration file my.cnf,

Locate the Server-id line and change the following

Server-id = 1

and add two lines of necessary information:

Log-bin = D:/log-bin.log #二进制变更日值的存放位置

binlog-do-db = Account #要同步的数据库

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.