Mysql dual-Machine backup

Source: Internet
Author: User

Mysql dual-Machine backup method:

In Unix, It is/etc/mysql/my. cnf or/MySQL user's home directory/my. cnf.

In windows, it depends on the location of the my. ini file you called, and my location is under the mysql root directory.

Setting method:
Set the sample environment:
Operating System: Windows xp
MySQL: 4.4.1

A ip: 192.168.1.100 master
B IP: 192.168.1.10 slave
A: Set
1. Add the most synchronous User Account:
Grant file on *. * TO backup @ "192.168.1.10" identified by '20140901 ';
Note that the backup user must have the permission to operate the table.
2. Add a database as the synchronization database:
Create database backup;
B: Set
1. Add the most synchronous User Account:
Grant file on *. * TO backup @ '192. 168.1.100 'identified by '123 ';
Note that the backup user must have the permission to operate the table.
2. Add a database as the synchronization database:
Create database backup;

Master/Slave Mode: A-> B
A is the master
Modify the my. ini file of A and add the following configuration to the mysqld configuration item:
Server-id = 1
Log-bin
# Set the log to be recorded. You can set log-bin = c: \ mysqlbak \ mysqllog and create the c: \ mysqlback directory. mysqllog is the file name generated.
# Mysqllog is the name of the log file. mysql creates several log files with Different Extensions named mysqllog.

Restart the database service.
Use the show master status Command to view the logs.

  • 1
  • 2
  • Next Page

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.