Pre-requites:
- Must have MySQL Enterprise Edition installed
- Download media file : meb-4.1.0-el6.x86_64.rpm (For Linux Platform)
Installation of MySQL Enterprise Backup
Command to install rpm of MySQL Enterprise Backup : rpm -ivh meb-4.1.0-el6.x86_64.rpm
Configuration Setup
Create a user named:”backup” to perform backup and restrict the permissions accordingly i.e. assign the following permissions
1 2 3 4 5 | GRANT SELECT, RELOAD, SHOW DATABASES, SUPER, LOCK TABLES, REPLICATION CLIENT, EVENT ON *.* TO 'backup'@'localhost' GRANT CREATE TEMPORARY TABLES ON `mysql`.* TO 'backup'@'localhost' GRANT INSERT, UPDATE, CREATE, DROP ON `mysql`.`backup_progress` TO 'backup'@'localhost' GRANT INSERT, UPDATE, CREATE, DROP ON `mysql`.`ibbackup_binlog_marker` TO 'backup'@'localhost' GRANT SELECT, INSERT, UPDATE, CREATE, DROP ON `mysql`.`backup_history` TO 'backup'@'localhost' |
By the execution of above command to assign permission this user will be enrolled in BackupAdmin & ProcessAdmin Roles.
Command Statement to perform Backups
Full
1 2 | /xxx/mysql/meb-4.1/bin/mysqlbackup --port=3306 --protocol=tcp --user=backup --password='xxxxxxxx' --backup-dir='/home/mysql/bk' --backup-image='/home/mysql/bk/full.img' backup-to-image --compress<strong>Incremental</strong> |
1 2 3 | /xxx/mysql/meb-4.1/bin/mysqlbackup --port=3306 --protocol=tcp --user=backup --password='xxxxxxxx' --backup-image=$BACKUP_IMAGE --backup-dir=$INC_BACKUP_DIR --incremental-base=history:last_backup --incremental=optimistic backup-to-image |
Commands/Statements to perform Restoration
Full
1 2 3 | /xxxx/mysql/meb-4.1/bin/mysqlbackup --port=3306 --protocol=tcp --user=backup --password='xxxxxxx' --datadir=/var/lib/mysql --backup-image=/home/mysql_backup/bkp/full.img --backup-dir=/home/mysql_backup/bkp copy-back-and-apply-log --uncompress --force |
Backup Verification:
you can check the status and complete history of backups by the following command.
1 | select * from backup_history |
If Enterprise Monitoring tool is configured then you may also view the graphical interface for backups as follows: