Table of Contents
- 7.1 Backup and Recovery Types
- 7.2 Database Backup Methods
- 7.3 Example Backup and Recovery Strategy
- 7.4 Using mysqldump for Backups
- 7.5 Point-in-Time (Incremental) Recovery Using the Binary Log
- 7.6 MyISAM Table Maintenance and Crash Recovery
It is important to back up your databases so that you can recover your data and be up and running again in case problems occur, such as system crashes, hardware failures, or users deleting data by mistake. Backups are also essential as a safeguard before upgrading a MySQL installation, and they can be used to transfer a MySQL installation to another system or to set up replica servers.
MySQL offers a variety of backup strategies from which you can choose the methods that best suit the requirements for your installation. This chapter discusses several backup and recovery topics with which you should be familiar:
Types of backups: Logical versus physical, full versus incremental, and so forth.
Methods for creating backups.
Recovery methods, including point-in-time recovery.
Backup scheduling, compression, and encryption.
Table maintenance, to enable recovery of corrupt tables.
Resources related to backup or to maintaining data availability include the following:
Customers of MySQL Enterprise Edition can use the MySQL Enterprise Backup product for backups. For an overview of the MySQL Enterprise Backup product, see Section 24.2, “MySQL Enterprise Backup Overview”.
A forum dedicated to backup issues is available at https://forums.mysql.com/list.php?28.
The syntax of the SQL statements described here is given in Chapter 13, SQL Statements.
For additional information about
InnoDBbackup procedures, see Section 14.18.1, “InnoDB Backup”.
Replication enables you to maintain identical data on multiple servers. This has several benefits, such as enabling client query load to be distributed over servers, availability of data even if a given server is taken offline or fails, and the ability to make backups with no impact on the source by using a replica server. See Chapter 17, Replication.
NDB Cluster provides a high-availability, high-redundancy version of MySQL adapted for the distributed computing environment. See Chapter 18, MySQL NDB Cluster 7.3 and NDB Cluster 7.4, which provides information about MySQL NDB Cluster 7.4 (based on MySQL 5.6 but containing the latest improvements and fixes for the
Distributed Replicated Block Device (DRBD) is another high-availability solution. It works by replicating a block device from a primary server to a secondary server at the block level. See Chapter 16, High Availability and Scalability.