|
mysqlbackup 备份出单一文件
导出单一文件和备份目录: mysqlbackup -u root -p --host=127.0.01 --backup-image=/root/all.bak --backup_dir=/root/singe_backup/ backup-to-image;
导出单文件目录然后转换: mysqlbackup -u root -p --host 127.0.0.1 --backup-dir=/root/singe_backup/ --backup-image=- backup-to-image > /root/world.bak
使用备份目录转换诚单一镜像文件。 [root@mysqldb backup]# mysqlbackup --backup-dir=/root/backup --backup-image=all.bak backup-dir-to-image;
单一文件转换为备份目录 [root@mysqldb ~]# mysqlbackup -u root -p --host=127.0.0.1 --backup-image=/root/all.bak --backup_dir=/root/backup image-to-backup-dir
提取镜像文件中的某一文件。 [root@mysqldb ~]# mysqlbackup --backup-image=/root/all.bak --src-entry=/employees/db.opt extract;
使用mysqlbackup 需要数据库用户的权限有以下: GRANT RELOAD ON *.* TO 'backupuser'@'localhost'; GRANT CREATE TEMPORARY TABLES ON mysql.* TO 'backupuser'@'localhost'; GRANT CREATE, INSERT, DROP, UPDATE ON mysql.ibbackup_binlog_marker TO 'backupuser'@'localhost'; GRANT CREATE, INSERT, DROP, UPDATE ON mysql.backup_progress TO 'backupuser'@'localhost'; GRANT CREATE, INSERT, SELECT, DROP, UPDATE ON mysql.backup_history TO 'backupuser'@'localhost'; GRANT REPLICATION CLIENT ON *.* TO 'backupuser'@'localhost'; GRANT SUPER ON *.* TO 'backupuser'@'localhost'; FLUSH PRIVILEGES;
|
|