5.1.1.1 Backup Operations

The backup operations are the most frequently performed tasks by MySQL Enterprise Backup. Various kinds of backups can be performed by adding different options, like using --compress or --incremental for compressed or incremental backups. Here is the syntax for the mysqlbackup command for performing a backup operation:

mysqlbackup [STD-OPTIONS]
            [CONNECTION-OPTIONS]
            [SERVER-REPOSITORY-OPTIONS]
            [BACKUP-REPOSITORY-OPTIONS]
            [METADATA-OPTIONS]
            [COMPRESSION-OPTIONS]
            [SPECIAL-BACKUP-TYPES-OPTIONS]
            [INCREMENTAL-BACKUP-OPTIONS]
            [PARTIAL-BACKUP-OPTIONS]
            [SINGLE-FILE-BACKUP-OPTIONS]
            [PERFORMANCE-SCALABILITY-CAPACITY-OPTIONS]            
            [MESSAGE-LOGGING-OPTIONS]
            [PROGRESS-REPORT-OPTIONS]
            backup | backup-and-apply-log

mysqlbackup [STD-OPTIONS]
            [CONNECTION-OPTIONS]
            [SERVER-REPOSITORY-OPTIONS]
            [BACKUP-REPOSITORY-OPTIONS]
            [METADATA-OPTIONS]
            [COMPRESSION-OPTIONS]
            [SPECIAL-BACKUP-TYPES-OPTIONS]
            [INCREMENTAL-BACKUP-OPTIONS]
            [PARTIAL-BACKUP-OPTIONS]
            [SINGLE-FILE-BACKUP-OPTIONS]
            [PERFORMANCE-SCALABILITY-CAPACITY-OPTIONS]            
            [MESSAGE-LOGGING-OPTIONS]
            [PROGRESS-REPORT-OPTIONS]
            [ENCRYPTION-OPTIONS]
            [CLOUD-STORAGE-OPTIONS]
            backup-to-image

Example 5.1 Simple Backup with Connection Parameters from Default Configuration File

The following example shows a minimal backup with the mysqlbackup command, with any necessary connection parameters for the database in the [mysqlbackup] section of the default MySQL configuration file:

mysqlbackup --backup-dir=/export/backups/latest backup

Example 5.2 Basic Incremental Backup

mysqlbackup --incremental --start-lsn=12345 --incremental-backup-dir=/path/to/incbackup backup

There is a separate directory dedicated to incremental backup. Both this directory and the one for full backups can be specified in the my.cnf file, and the appropriate directory is used depending on the type of backup. Both the incremental backup data and an earlier full backup are needed to do a successful restore operation.