Because Mysqldump is a logical backup, and backups are inefficient, backups cannot be made quickly when there is a large amount of data
Using Xtrabackup is an excellent backup solution at this time.
1. Full backup and full restore
Backup:--backup
Innobackupex--defaults-file=/etc/my.cnf.d/server.cnf--host=127.0.0.1--user=liuwei--password=123456--backup/ tmp/backup/
Option Description:
--defaults-file: Indicates the server's configuration file, this parameter must be the first parameter of the Innobackupex, otherwise the error
--host: Indicates the host
--user: Indicates the user name of the backup
--password: Indicates the password for the backup user name
--backup: indicated as a backup, this parameter can be ignored
/tmp/backup: The directory to be backed up
Application:--apply-log
Innobackupex--apply-log 2016-07-04_17-18-53/
Note: You need to apply the collected redo log to the backup data file before you restore
Restore:--copy-back
Innobackupex--copy-back 2016-07-04_15-26-49/
Note: Actions that need to be done before you restore
1. Close the database
2. Delete all files in the data directory
3. Then restore
4. After restore, you need to modify the data directory permissions, because the default owner after restore is root, need to change to MySQL
5. Restart MySQL
This article is from the "burning Years of Passion" blog, please be sure to keep this source http://liuzhengwei521.blog.51cto.com/4855442/1882359
Backup with Xtrabackup Mariadb-galera-cluster