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.