新聞中心
這里有您想知道的互聯(lián)網(wǎng)營銷解決方案
使用xtrabackup對mysql5.7進行備份
xtrabackup是Percona公司CTO Vadim參與開發(fā)的一款基于InnoDB的在線熱備工具,具有開源,免費,支持在線熱備,備份恢復速度快,占用磁盤空間小等特點,并且支持不同情況下的多種備份形式。

成都創(chuàng)新互聯(lián)公司專注于網(wǎng)站建設|網(wǎng)頁維護|優(yōu)化|托管以及網(wǎng)絡推廣,積累了大量的網(wǎng)站設計與制作經(jīng)驗,為許多企業(yè)提供了網(wǎng)站定制設計服務,案例作品覆蓋圍欄護欄等行業(yè)。能根據(jù)企業(yè)所處的行業(yè)與銷售的產(chǎn)品,結(jié)合品牌形象的塑造,量身建設品質(zhì)網(wǎng)站。
安裝XtraBackup
這里不多做解釋了,之前文章有介紹如何安裝。 這里主要說下常見報錯,比如我這里今天遇到兩個:
error: Failed dependencies:
libev.so.4()(64bit) is needed by percona-xtrabackup-24-2.4.4-1.el6.x86_64
libnuma.so.1()(64bit) is needed by percona-xtrabackup-24-2.4.4-1.el6.x86_64
(1) libev.so.4()(64bit) is needed by percona-xtrabackup-24-2.4.4-1..el6.x86_64解決辦法:
rpm -ivh ftp://rpmfind.net/linux/dag/redhat/el6/en/x86_64/dag/RPMS/libev-4.15-1.el6.rf.x86_64.rpm
安裝上邊rpm包解決
(2)libnuma.so.1()(64bit) is needed by percona-xtrabackup-24-2.4.4-1.el6.x86_64解決辦法:
rpm -ivh http://mirror.centos.org/centos/6/os/x86_64/Packages/numactl-2.0.9-2.el6.x86_64.rpm
安裝上邊rpm包解決。
備份mysql
這里我們寫一個shell腳本做備份
#!/bin/bash
# mysql full back
#date 2016.10.18
#author:21yunwei
time=`date +%F`
logfile="/data/bakup/mysql_full_bak_time.log"
fullbakup_logfile="/data/bakup/fullbakup_logfile.log"
mysql_bakdir="/data/bakup"
user=xxxxx
password=xxxxxxx
[ ! -d $mysql_bakdir ] && mkdir -p $mysql_bakdir
[ ! -e $logfile ] && touch $logfile
[ ! -e $fullbakup_logfile ] && touch $fullbakup_logfile
innobackupex --defaults-file=/etc/my.cnf --user=$user --password=$passsword--compress ${mysql_bakdir} 2>&1 >>$fullbakup_logfile
ret=$?
finishtime=`date +%Y%m%d_%H%M%S`
[ $ret -eq 0 ] && echo "Mysql fullbakup finished, time: $finishtime" >> $logfile || echo "Mysql fullbakup failed,please check time:$finishtime" >> $logfile
網(wǎng)頁標題:使用xtrabackup對mysql5.7進行備份
URL分享:http://m.5511xx.com/article/cdseecg.html


咨詢
建站咨詢
