设为首页 加入收藏

TOP

使用XtraBackup 备份MySQL数据库(一)
2016-12-28 08:15:44 】 浏览:536
Tags:使用 XtraBackup 备份 MySQL 数据库

本次测试使用XtraBackup备份MySQL数据库


版本:XtraBackup2.4.5+MySQL5.7.16


下载地址:https://www.percona.com/downloads/XtraBackup/


1、安装XtraBackup


本次为了方便,使用解压版本进行安装,直接解压就可以用了。


使用过程中可能会遇到缺少perl依赖包的问题,我的方法是直接操作把镜像包里的perl都安装了,yum install -y perl*


2、简介


XtraBackup主要包括两个备份工具xtrabackup和innobackupex。其中innobackupex对xtrabackup进行了封装。本次只介绍innobackupex备份MySQL


3、全量备的操作方法


1)创建备份


#创建存储备份数据的目录
[root@rhel7 ~]# mkdir /mysqlbackup
#开始备份
[root@rhel7 ~]# innobackupex --user=root --password=123456 /mysqlbackup
161213 12:27:13 innobackupex: Starting the backup operation

IMPORTANT: Please check that the backup run completes successfully.
At the end of a successful backup run innobackupex
prints "completed OK!".

161213 12:27:13 version_check Connecting to MySQL server with DSN 'dbi:mysql:;mysql_read_default_group=xtrabackup' as 'root' (using password: YES).
Failed to connect to MySQL server: DBI connect(';mysql_read_default_group=xtrabackup','root',...) failed: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2) at - line 1314.
161213 12:27:13 Connecting to MySQL server host: localhost, user: root, password: set, port: 0, socket: (null)
Using server version 5.7.16
innobackupex version 2.4.5 based on MySQL server 5.7.13 Linux (x86_64) (revision id: e41c0be)
xtrabackup: uses posix_fadvise().
xtrabackup: cd to /usr/local/mysql/data
xtrabackup: open files limit requested 0, set to 1024
xtrabackup: using the following InnoDB configuration:
xtrabackup: innodb_data_home_dir = .
xtrabackup: innodb_data_file_path = ibdata1:12M:autoextend
xtrabackup: innodb_log_group_home_dir = ./
xtrabackup: innodb_log_files_in_group = 2
xtrabackup: innodb_log_file_size = 50331648
InnoDB: Number of pools: 1
161213 12:27:13 >> log scanned up to (2671643)
xtrabackup: Generating a list of tablespaces
InnoDB: Allocated tablespace ID 2 for mysql/plugin, old maximum was 0
161213 12:27:13 [01] Copying ./ibdata1 to /mysqlbackup/2016-12-13_12-27-13/ibdata1
161213 12:27:14 >> log scanned up to (2671643)
161213 12:27:15 [01] ...done
161213 12:27:15 >> log scanned up to (2671643)
161213 12:27:15 [01] Copying ./mysql/plugin.ibd to /mysqlbackup/2016-12-13_12-27-13/mysql/plugin.ibd
161213 12:27:15 [01] ...done
......
161213 12:27:16 [01] Copying ./wl/zx.ibd to /mysqlbackup/2016-12-13_12-27-13/wl/zx.ibd
161213 12:27:16 [01] ...done
161213 12:27:16 >> log scanned up to (2671643)
161213 12:27:16 Executing FLUSH NO_WRITE_TO_BINLOG TABLES...
161213 12:27:16 Executing FLUSH TABLES WITH READ LOCK...
161213 12:27:16 Starting to backup non-InnoDB tables and files
161213 12:27:16 [01] Copying ./mysql/db.opt to /mysqlbackup/2016-12-13_12-27-13/mysql/db.opt
161213 12:27:16 [01] ...done
......
161213 12:27:18 [01] Copying ./wl/wl.frm to /mysqlbackup/2016-12-13_12-27-13/wl/wl.frm
161213 12:27:18 [01] ...done
161213 12:27:18 [01] Copying ./wl/zx.frm to /mysqlbackup/2016-12-13_12-27-13/wl/zx.frm
161213 12:27:18 [01] ...done
161213 12:27:18 Finished backing up non-InnoDB tables and files
161213 12:27:18 Executing FLUSH NO_WRITE_TO_BINLOG ENGINE LOGS...
xtrabackup: The latest check point (for incremental): '2671634'
xtrabackup: Stopping log copying thread.
.161213 12:27:18 >> log scanned up to (2671643)

161213 12:27:18 Executing UNLOCK TABLES
161213 12:27:18 All tables unlocked
161213 12:27:18 [00] Copying ib_buffer_pool to /mysq

首页 上一页 1 2 3 4 5 下一页 尾页 1/5/5
】【打印繁体】【投稿】【收藏】 【推荐】【举报】【评论】 【关闭】 【返回顶部
上一篇Oracle dba_data_files数据字典里.. 下一篇Redis3.0.7集群部署完整版

最新文章

热门文章

Hot 文章

Python

C 语言

C++基础

大数据基础

linux编程基础

C/C++面试题目