1. MySQL Tutorial Database Tutorial There is no mechanism for incremental backups, and backup is a big problem when the volume of data is too large. Fortunately, the MySQL database provides a master-slave backup mechanism, which is to write all the data in the primary database at the same time to the backup database. To achieve a hot backup of the MySQL database.
2. In order to realize the hot standby of two machines, you must first understand the requirements of the master and slave database server version. To achieve a hot standby version of MySQL is higher than 3.2, there is also a basic principle is that the database version from the database can be higher than the primary server database version, but not lower than the primary server version of the database.
3. Set up the primary database server: 111cn.net
A. First see if the version of the primary server is a backup-hot version. Then look at the configuration of the MYSQLD configuration block in My.cnf (Unix-like) or My.ini (Windows) there is no Log-bin (logging database change log), because the MySQL replication mechanism is based on the log replication mechanism, so the primary server must support the change log. Then set up the database to write to the log or do not write to the log. This will only make changes to the database that you are interested in writing to the database log.
Server-id=1//database ID This should default to be 1 do not have to change
Log-bin=log_name//log file name, where you can make log to other directories if no setting then a log name for the default host name
Binlog-do-db=db_name//Log database
Binlog-ignore-db=db_name//No log database
If more than one database is used "," split
Then set up a synchronization database user account br> mysql> GRANT REPLICATION SLAVE on *.*
-> to ' repl ' @ '%.mydomain.com ' identified by ' slavepass ';
4.0.2 Previous versions because replication is not supported to implement this feature using the following statement
Mysql> GRANT FILE on *.*
-> to ' repl ' @ '%.mydomain.com ' I Dentified by ' Slavepass ';
Restart the database after setting the configuration file for the primary server
B. Lock the existing database and back up the current data