MYSQL5 Masterslave Data Synchronization Configuration Method 1th/3 page _mysql

Source: Internet
Author: User

Test environment. Basically the data is instantaneous sync, hope to be helpful to everybody
RedHat ES 3 Update 3
MYSQL 5.0.15
MySQL data synchronization backup
A server: 192.168.1.2 Master server Master

B Server: 192.168.1.3 Vice Server slave

A server settings

#mysql –u root–p

Mysql>grant FILE on *.* to backup@192.168.1.3 identified by ' 1234 ';

Mysql>exit

Above is master open an account backup password 1234 give ip:192.168.1.3 the right to file processing

Mysqladmin–u root–p shutdown

Exporting Master's database to a slave machine, you can choose to export a database that needs to be synchronized

Modify the/ETC/MY.CNF on a machine

Add parameters to [mysqld] section

Log-bin=mysql-bin

Server-id=1

binlog_do_db = Gbbbs (database to synchronize)

binlog_ignore_db = Mysql,test,information_schema (libraries that do not need to be synchronized, 5.0 have information_schema this library)

Sql-bin-update-same

Reboot a server MySQL

b Server Settings

Set/ETC/MY.CNF

Join in [mysqld] section

Server-id = 2 (if there are slave users, their IDs will also increase, such as server-id=3)

Master-host = 192.168.112.71

Master-user = Backup

Master-password = 1234

Replicate-do-db = Gbbbs

#replicate-do-db = Database2

Log-warnings

master-port=3306

Master-connect-retry = 60

Restart MySQL for Server B

There are master.info files in the database folder to view the sync information

is actually MySQL Replication

Current 1/3 page 123 Next read the full text

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.