mydumper 0.6.2 安装,dba的必备备份工具,必须掌握

本文涉及的产品
云数据库 RDS MySQL Serverless,0.5-2RCU 50GB
云数据库 RDS MySQL Serverless,价值2615元额度,1个月
简介:

新年第一天,祝愿所有的数据库都平平安安!


直接看安装过程,缺少包的自己看readme 安装好了。

[root@mysql93 local]# tar -xvf mydumper-0.6.2.tar.gz

mydumper-0.6.2/CMakeLists.txt

mydumper-0.6.2/README

mydumper-0.6.2/binlog.c

mydumper-0.6.2/binlog.h

mydumper-0.6.2/cmake/

mydumper-0.6.2/common.h

mydumper-0.6.2/config.h.in

mydumper-0.6.2/docs/

mydumper-0.6.2/g_unix_signal.c

mydumper-0.6.2/g_unix_signal.h

mydumper-0.6.2/mydumper.c

mydumper-0.6.2/mydumper.h

mydumper-0.6.2/myloader.c

mydumper-0.6.2/myloader.h

mydumper-0.6.2/server_detect.c

mydumper-0.6.2/server_detect.h

mydumper-0.6.2/cmake/modules/

mydumper-0.6.2/cmake/modules/CppcheckTargets.cmake

mydumper-0.6.2/cmake/modules/FindGLIB2.cmake

mydumper-0.6.2/cmake/modules/FindMySQL.cmake

mydumper-0.6.2/cmake/modules/FindPCRE.cmake

mydumper-0.6.2/cmake/modules/FindSphinx.cmake

mydumper-0.6.2/cmake/modules/Findcppcheck.cmake

mydumper-0.6.2/cmake/modules/Findcppcheck.cpp

mydumper-0.6.2/docs/CMakeLists.txt

mydumper-0.6.2/docs/_build/

mydumper-0.6.2/docs/_static/

mydumper-0.6.2/docs/authors.rst

mydumper-0.6.2/docs/compiling.rst

mydumper-0.6.2/docs/examples.rst

mydumper-0.6.2/docs/files.rst

mydumper-0.6.2/docs/index.rst

mydumper-0.6.2/docs/mydumper_usage.rst

mydumper-0.6.2/docs/myloader_usage.rst

mydumper-0.6.2/docs/_build/conf.py.in

mydumper-0.6.2/docs/_build/sources.cmake.in

[root@mysql93 local]# ll

总用量 10036

drwxr-xr-x.  2 root root    4096 11月 23 00:06 bin

drwxr-xr-x.  5 root root    4096 11月 18 2015 etc

drwxr-xr-x.  2 root root    4096 9月  23 2011 games

drwxr-xr-x  10 root root    4096 6月   1 2016 inception

drwxr-xr-x.  2 root root    4096 9月  23 2011 include

drwxr-xr-x   2 root root    4096 5月  11 2016 lepus

drwxr-xr-x.  2 root root    4096 9月  23 2011 lib

drwxr-xr-x.  2 root root    4096 9月  23 2011 lib64

drwxr-xr-x.  2 root root    4096 9月  23 2011 libexec

drwxr-xr-x   4 root root    4096 12月 29 22:02 mydumper-0.6.2

-rw-r--r--   1 root root   40165 9月  30 16:33 mydumper-0.6.2.tar.gz

drwxrwxr-x   6 root root    4096 11月 23 03:10 redis-3.0.7

-rw-r--r--   1 root root 1375200 11月 25 10:01 redis-3.0.7.tar.gz

drwxr-xr-x.  2 root root    4096 11月 18 2015 sbin

drwxr-xr-x.  5 root root    4096 8月   3 2015 share

drwxr-xr-x.  3 root root    4096 12月 10 2015 src

[root@mysql93 local]# cd mydumper-0.6.2

[root@mysql93 mydumper-0.6.2]# ll

总用量 140

-rw-r--r-- 1 root root  8171 9月   6 2014 binlog.c

-rw-r--r-- 1 root root  1244 9月   6 2014 binlog.h

drwxr-xr-x 3 root root  4096 12月 29 22:02 cmake

-rw-r--r-- 1 root root  2339 9月   6 2014 CMakeLists.txt

-rw-r--r-- 1 root root  2081 9月   6 2014 common.h

-rw-r--r-- 1 root root   101 9月   6 2014 config.h.in

drwxr-xr-x 4 root root  4096 12月 29 22:02 docs

-rw-r--r-- 1 root root  3614 9月   6 2014 g_unix_signal.c

-rw-r--r-- 1 root root   339 9月   6 2014 g_unix_signal.h

-rw-r--r-- 1 root root 65450 9月   6 2014 mydumper.c

-rw-r--r-- 1 root root  1937 9月   6 2014 mydumper.h

-rw-r--r-- 1 root root 12742 9月   6 2014 myloader.c

-rw-r--r-- 1 root root  1284 9月   6 2014 myloader.h

-rw-r--r-- 1 root root  2458 9月   6 2014 README

-rw-r--r-- 1 root root  2021 9月   6 2014 server_detect.c

-rw-r--r-- 1 root root  1116 9月   6 2014 server_detect.h

[root@mysql93 mydumper-0.6.2]# cmake .

-- The C compiler identification is GNU 4.4.7

-- The CXX compiler identification is GNU 4.4.7

-- Check for working C compiler: /usr/bin/cc

-- Check for working C compiler: /usr/bin/cc -- works

-- Detecting C compiler ABI info

-- Detecting C compiler ABI info - done

-- Check for working CXX compiler: /usr/bin/c++

-- Check for working CXX compiler: /usr/bin/c++ -- works

-- Detecting CXX compiler ABI info

-- Detecting CXX compiler ABI info - done

-- Using mysql-config: /usr/bin/mysql_config

-- Found MySQL: /usr/include/mysql, /usr/lib64/libmysqlclient.so;/usr/lib64/libpthread.so;/usr/lib64/libm.so;/usr/lib64/librt.so;/usr/lib64/libdl.so

-- Found ZLIB: /usr/lib64/libz.so (found version "1.2.3") 

-- Found PkgConfig: /usr/bin/pkg-config (found version "0.23") 

-- checking for one of the modules 'glib-2.0'

-- checking for one of the modules 'gthread-2.0'

-- checking for module 'libpcre'

--   found libpcre, version 7.8

-- Found PCRE: /usr/include  


CMake Warning at docs/CMakeLists.txt:9 (message):

  Unable to find Sphinx documentation generator



-- ------------------------------------------------

-- MYSQL_CONFIG = /usr/bin/mysql_config

-- CMAKE_INSTALL_PREFIX = /usr/local

-- BUILD_DOCS = ON

-- WITH_BINLOG = OFF

-- RUN_CPPCHECK = OFF

-- Change a values with: cmake -D<Variable>=<Value>

-- ------------------------------------------------

-- 

-- Configuring done

-- Generating done

-- Build files have been written to: /usr/local/mydumper-0.6.2

[root@mysql93 mydumper-0.6.2]# make 

Scanning dependencies of target mydumper

[ 25%] Building C object CMakeFiles/mydumper.dir/mydumper.c.o

[ 50%] Building C object CMakeFiles/mydumper.dir/server_detect.c.o

[ 75%] Building C object CMakeFiles/mydumper.dir/g_unix_signal.c.o

Linking C executable mydumper

[ 75%] Built target mydumper

Scanning dependencies of target myloader

[100%] Building C object CMakeFiles/myloader.dir/myloader.c.o

Linking C executable myloader

[100%] Built target myloader

[root@mysql93 mydumper-0.6.2]# make install 

[ 75%] Built target mydumper

[100%] Built target myloader

Install the project...

-- Install configuration: ""

-- Installing: /usr/local/bin/mydumper

-- Installing: /usr/local/bin/myloader

[root@mysql93 mydumper-0.6.2]# 


[root@mysql93 mydumper-0.6.2]# mydumper --help

Usage:

  mydumper [OPTION...] multi-threaded MySQL dumping


Help Options:

  -?, --help                  Show help options


Application Options:

  -B, --database              Database to dump

  -T, --tables-list           Comma delimited table list to dump (does not exclude regex option)

  -o, --outputdir             Directory to output files to

  -s, --statement-size        Attempted size of INSERT statement in bytes, default 1000000

  -r, --rows                  Try to split tables into chunks of this many rows. This option turns off --chunk-filesize

  -F, --chunk-filesize        Split tables into chunks of this output file size. This value is in MB

  -c, --compress              Compress output files

  -e, --build-empty-files     Build dump files even if no data available from table

  -x, --regex                 Regular expression for 'db.table' matching

  -i, --ignore-engines        Comma delimited list of storage engines to ignore

  -m, --no-schemas            Do not dump table schemas with the data

  -k, --no-locks              Do not execute the temporary shared read lock.  WARNING: This will cause inconsistent backups

  --less-locking              Minimize locking time on InnoDB tables.

  -l, --long-query-guard      Set long query timer in seconds, default 60

  -K, --kill-long-queries     Kill long running queries (instead of aborting)

  -D, --daemon                Enable daemon mode

  -I, --snapshot-interval     Interval between each dump snapshot (in minutes), requires --daemon, default 60

  -L, --logfile               Log file name to use, by default stdout is used

  --tz-utc                    SET TIME_ZONE='+00:00' at top of dump to allow dumping of TIMESTAMP data when a server has data in different time zones or data is being moved between servers with different time zones, defaults to on use --skip-tz-utc to disable.

  --skip-tz-utc               

  --use-savepoints            Use savepoints to reduce metadata locking issues, needs SUPER privilege

  --success-on-1146           Not increment error count and Warning instead of Critical in case of table doesn't exist

  --lock-all-tables           Use LOCK TABLE for all, instead of FTWRL

  -h, --host                  The host to connect to

  -u, --user                  Username with privileges to run the dump

  -p, --password              User password

  -P, --port                  TCP/IP port to connect to

  -S, --socket                UNIX domain socket file to use for connection

  -t, --threads               Number of threads to use, default 4

  -C, --compress-protocol     Use compression on the MySQL connection

  -V, --version               Show the program version and exit

  -v, --verbose               Verbosity of output, 0 = silent, 1 = errors, 2 = warnings, 3 = info, default 2


  

  [root@mysql93 mydumper-0.6.2]# myloader --help

Usage:

  myloader [OPTION...] multi-threaded MySQL loader


Help Options:

  -?, --help                        Show help options


Application Options:

  -d, --directory                   Directory of the dump to import

  -q, --queries-per-transaction     Number of queries per transaction, default 1000

  -o, --overwrite-tables            Drop tables if they already exist

  -B, --database                    An alternative database to restore into

  -e, --enable-binlog               Enable binary logging of the restore data

  -h, --host                        The host to connect to

  -u, --user                        Username with privileges to run the dump

  -p, --password                    User password

  -P, --port                        TCP/IP port to connect to

  -S, --socket                      UNIX domain socket file to use for connection

  -t, --threads                     Number of threads to use, default 4

  -C, --compress-protocol           Use compression on the MySQL connection

  -V, --version                     Show the program version and exit

  -v, --verbose                     Verbosity of output, 0 = silent, 1 = errors, 2 = warnings, 3 = info, default 2


[root@mysql93 mydumper-0.6.2]# 



[root@mysql93 db_backup]# mydumper -u root -p root -h 192.168.1.93 -t 8 -o /data/db_backup/fullbak_$(date +%F)

[root@mysql93 db_backup]# myloader -u root -p root -h 192.168.1.93 -t 8 -o -d ./fullbak_2016-12-29/










本文转自 roidba 51CTO博客,原文链接:http://blog.51cto.com/roidba/1888005,如需转载请自行联系原作者
相关实践学习
基于CentOS快速搭建LAMP环境
本教程介绍如何搭建LAMP环境,其中LAMP分别代表Linux、Apache、MySQL和PHP。
全面了解阿里云能为你做什么
阿里云在全球各地部署高效节能的绿色数据中心,利用清洁计算为万物互联的新世界提供源源不断的能源动力,目前开服的区域包括中国(华北、华东、华南、香港)、新加坡、美国(美东、美西)、欧洲、中东、澳大利亚、日本。目前阿里云的产品涵盖弹性计算、数据库、存储与CDN、分析与搜索、云通信、网络、管理与监控、应用服务、互联网中间件、移动服务、视频服务等。通过本课程,来了解阿里云能够为你的业务带来哪些帮助 &nbsp; &nbsp; 相关的阿里云产品:云服务器ECS 云服务器 ECS(Elastic Compute Service)是一种弹性可伸缩的计算服务,助您降低 IT 成本,提升运维效率,使您更专注于核心业务创新。产品详情: https://www.aliyun.com/product/ecs
目录
相关文章
|
4月前
|
SQL 存储 Oracle
oracle如何定期备份数据库sql文件
【1月更文挑战第7天】oracle如何定期备份数据库sql文件
58 8
|
关系型数据库 MySQL 数据库
【MySQL】Xtrabackup备份工具使用
Xtrabackup是由percona提供的mysql数据库备份工具,支持在线热备份(备份时不影响数据读写). Xtrabackup有两个主要的工具:xtrabackup、innobackupex 1、xtrabackup只能备份InnoDB和XtraDB两种数据表,而不能备份MyISAM数据表 2、innobackupex是参考了InnoDB Hotbackup的innoback脚本修改而来的.innobackupex是一个perl脚本封装,封装了xtrabackup。主要是为了方便的 同时备份InnoDB和MyISAM引擎的表,但在处理myisam时需要加一个读锁。并且加入了一些使用的选项
269 0
|
关系型数据库 MySQL Shell
mysqldump工具备份数据
mysqldump工具备份数据
mysqldump工具备份数据
|
关系型数据库 MySQL 数据库
数据库管理的MySQL备份和恢复命令
mysqldump 是一个命令行客户端程序,用于转储本地或远程 MySQL 用于备份到单个平面文件中的数据库或数据库集合。
230 0
|
存储 关系型数据库 MySQL
mydumper备份工具介绍与使用
前面文章有介绍过 MySQL 系统自带的 mysqldump 备份工具的使用,其实还有一个开源工具 mydumper 同样适用于 MySQL 的逻辑备份。之前一直没有正式体验过,只是听说比 mysqldump 要快很多,具体使用效果如何, 一起来看下吧。
411 0
|
关系型数据库 MySQL 数据库
mysql安装使用mydumper备份工具
mysql安装使用mydumper备份工具
1532 0
|
SQL 关系型数据库 数据库
PostgreSQL 10.1 手册_部分 III. 服务器管理_第 25 章 备份和恢复_25.1. SQL转储
25.1. SQL转储 25.1.1. 从转储中恢复 25.1.2. 使用pg_dumpall 25.1.3. 处理大型数据库 SQL 转储方法的思想是创建一个由SQL命令组成的文件,当把这个文件回馈给服务器时,服务器将利用其中的SQL命令重建与转储时状态一样的数据库。
1393 0
|
监控 关系型数据库 MySQL
利用Xtrabackup工具备份及恢复(MySQL DBA的必备工具)
利用Xtrabackup工具备份及恢复(MySQL DBA的必备工具) Xtrabackup——MySQL DBA的必备工具 注意: 文档参照http://www.percona.com/docs/wiki/percona-xtrabackup:start mysql要使用5.1.50版本或以上。
4633 0