Chinese
MySQL database and backup and restore
From;    Author:Stand originally

In the database the watch is lost or the circumstance of attaint falls, back up your database is very important. If produce a system to break down, you think for certain can lose your watch least data to restore to break down as far as possible

The condition when happening. Sometimes, be MySQL administrator is caused destroy. The administrator has known to express in order to destroy, try to edit them directly with the editor such as such as Vi or Emacs, this is not absolutely to the watch

Meddlesome!

Backup database two main methods are to use Mysqldump program or document of direct copy database (if use Cp, Cpio or Tar,wait) . Every kinds of method has its actor drawback:

Mysqldump and MySQL server are operated in coordination. Direct copy method is in the server is exterior undertake, and you must take step assure to revising the watch that you will copy without the client. If you

Think with file system backup backs up database, also can produce same question: If database watch backs up be revised in the process in file system, enter the state with the watch file abhorrent subject of backup,

And right the following restore a watch to will lose a sense. File system backup and the distinction that copy a file directly are pair of latter you controlled backup process completely, such you can adopt measure to ensure the server lets a watch do not suffer

Interference.

Mysqldump wants than direct copy some slower.

Mysqldump is generated can transplant the text file of other machine, even on those machines that have different hardware structure. Direct copy file cannot transplant to go up to other machine, unless you are in beat

The watch of shellfish uses MyISAM memory form. ISAM watch can be only on the machine of similar hardware structure copy. The MyISAM list that introduces in MySQL 3.23 stores the format solved this problem, because of this case

The machine has nothing to do type, so direct copy file can transplant to go up to the machine that has different hardware structure. Want to satisfy two requirements only: Another machine also must run MySQL 3.23 or later edition

This, and the file must express with MyISAM format, is not ISAM format.

No matter you use method of which kinds of backup, if you need to restore a database, a few principles should be abided by, in order to ensure best result:

Carry out backup regularly. Establish a plan and abide by strictly.

Let a server carry out newer daily record. When after you are breaking down, should needing to restore data, newer daily record will help you. After restoring to count the state when backing up according to arriving with backup file in you, you can pass motion

The inquiry in updating a daily record all right applies the modification at the back of backup again, this restores the watch in the database to break down the condition when happening.
Previous12 Next