MySQL备份恢复工具安装

MySQL备份恢复工具安装

一、mydumper安装

​ 下载链接:https://github.com/maxbube/mydumper

​ 1、安装依赖包

yum install -y glib2-devel mysql-devel zlib-devel pcre-devel openssl-devel

​ 2、解压

tar -zxvf mydumper-0.9.5.tar.gz

​ 3、安装

cd mydumper-0.9.5
cmake .
make
二、xtrabackup 二进制安装

​ 下载链接:https://www.percona.com/downloads/Percona-XtraBackup-2.4/LATEST/

​ 或:https://github.com/percona/percona-xtrabackup/tree/2.4

​ 解压即可用

tar -zxvf percona-xtrabackup-2.4.18-Linux-x86_64.libgcrypt153.tar.gz
三、xtrabackup 源码安装

​ 下载链接:https://www.percona.com/downloads/Percona-XtraBackup-2.4/LATEST/

​ 或:https://github.com/percona/percona-xtrabackup/tree/2.4

​ 1、安装依赖包

yum install cmake gcc gcc-c++ libaio libaio-devel automake autoconf bzr bison libtool ncurses5-devel libgcrypt-devel libcurl-devel vim-common python-sphinx -y

​ 2、编译

unzip percona-xtrabackup-release-2.4.16.zip
mv percona-xtrabackup-release-2.4.16 xtrabackup-2.4.16
cd xtrabackup-2.4.16

cmake -DBUILD_CONFIG=xtrabackup_release -DWITH_BOOST=/usr/local/boost_1_59_0 && make -j4

​ 编译成功

[ 96%] Building CXX object sql/CMakeFiles/sql.dir/srv_session_info_service.cc.o
[ 96%] Building CXX object sql/CMakeFiles/sql.dir/srv_session_service.cc.o
[ 96%] Building CXX object sql/CMakeFiles/sql.dir/auth/sha2_password_common.cc.o
[ 96%] Building CXX object sql/CMakeFiles/sql.dir/mysqld_daemon.cc.o
Linking CXX static library ../archive_output_directory/libsql.a
[100%] Built target sql

​ 3、安装

make DESTDIR=/home/mysql/tools install

​ 安装成功

-- Up-to-date: /home/mysql/tools/usr/local/xtrabackup/xtrabackup-test/mysql-test-run
-- Installing: /home/mysql/tools/usr/local/xtrabackup/xtrabackup-test/lib/My/SafeProcess/my_safe_process
-- Up-to-date: /home/mysql/tools/usr/local/xtrabackup/xtrabackup-test/lib/My/SafeProcess/my_safe_process
-- Installing: /home/mysql/tools/usr/local/xtrabackup/xtrabackup-test/lib/My/SafeProcess/Base.pm
[mysql@localhost xtrabackup-2.4.16]$

​ 4、常见报错

#报错 1
CMake Error at cmake/libev.cmake:23 (MESSAGE):
  Could not find libev on your system
Call Stack (most recent call first):
  storage/innobase/xtrabackup/src/xbcloud/CMakeLists.txt:31 (FIND_EV)

#解决方法
#下载 libev 库
https://fossies.org/linux/misc/libev-4.31.tar.gz/
tar -zxvf libev-4.31.tar.gz  
./configure  
make && make install
#报错 2
Linking C static library libarchive.a
[ 23%] Built target archive_static
make: *** [all] Error 2

#解决方法
yum -y install python-sphinx
#报错 3
c++: internal compiler error: Killed (program cc1plus)
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://bugzilla.redhat.com/bugzilla> for instructions.
make[2]: *** [libmysqld/CMakeFiles/sql_embedded.dir/__/sql/item_geofunc_relchecks_bgwrap.cc.o] Error 4
[ 74%] Building CXX object sql/CMakeFiles/sql.dir/item_geofunc_internal.cc.o
make[1]: *** [libmysqld/CMakeFiles/sql_embedded.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
[ 74%] Building CXX object sql/CMakeFiles/sql.dir/item_geofunc_relchecks.cc.o
c++: internal compiler error: Killed (program cc1plus)
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://bugzilla.redhat.com/bugzilla> for instructions.
make[2]: *** [sql/CMakeFiles/sql.dir/item_geofunc_buffer.cc.o] Error 4
make[2]: *** Waiting for unfinished jobs....
make[1]: *** [sql/CMakeFiles/sql.dir/all] Error 2
make: *** [all] Error 2


Linking CXX static library ../archive_output_directory/libsql.a
[ 82%] Built target sql
make: *** [all] Error 2

#原因内存不够,建议内存调到 5G 以上
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值