Backing Up and Copying Databases

It's important to back up your databases in case tables are lost or damaged. If a system crash occurs, you want to be able to restore your tables to the state they were in at the time of the crash with as little data loss as possible. Likewise, a user who issues an unwise DROP DATABASE or DROP TABLE will likely show up at your door requesting that you perform data recovery. Sometimes it's the MySQL administrator who causes the damage. Administrators have been known to damage table files by trying to edit them directly using an editor such as vi or emacs. This is certain to do bad things to a table!

The two main methods for backing up databases are to use the mysqldump program or to directly copy database files ...

Get MySQL now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.