Ubuntu configuration Mysql Master-slave database _mysql

Source: Internet
Author: User
Tags mixed mysql version unique id

The environment: under the virtual machine

Server: Ubuntu 14.04 LTS

Database: 5.5.37
Port: 3306

Main ip:192.168.63.133

From ip:192.168.63.134

Authorized account:

User:suxh

password:111111

All right, finish up. Environment: We directly configure:

The first step: the master and slave two servers to have the same database (need to sync) here is the backup database (not much said, before the synchronization began, the main library copy to the library on the line)

The second step is to configure Master (master) database editing/etc/my.cnf mainly to open binary logs and set up the database to synchronize some parameters

# Binary Logging format-mixed recommended
binlog_format=mixed binlog-ignore-db=mysql binlog-do-db=
Backup
 
# required unique ID between 1 and 2^32-1
# defaults to 1 if Master-host was not set
# but would not Fu Nction as a master if omitted
server-id    = 1


Parameter explanation:

Server-id This is the only one that cannot follow the same server.

Binlog_format binary file format

Database ignored by binlog_ignore-db

Binlog-do-db the database to be synchronized

It is OK to restart the database after the setup is finished.

The third step from the database:

Similarly modified/etc/my.cnf in the MySQL version 5.1.7 does not support master-host "similar parameters; So as long as you configure server-id=2 here,

Then log in from the database settings

Change Master to master_host= ' 192.168.63.133 ', master_user= ' suxh ', master_password= ' 111111 ';
Slave start;


The basic configuration is good. Here is my brief note.

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.