mydumper介绍:
什么时候使用mydumper?
mydumper缺点
mydumper安装:
mydumper 安装和配置:
安装过程中遇到了两个文件
1:-- checking for one of the modules 'gthread-2.0'
CMake Error at /usr/local/share/cmake-2.8/Modules/FindPkgConfig.cmake:363 (message): sakila.actor-schema.sql
None of the required 'gthread-2.0' found
Call Stack (most recent call first):
cmake/modules/FindGLIB2.cmake:11 (pkg_search_module)
CMakeLists.txt:10 (find_package)
2:##安装
pcre-devel 即可解决问题
-- checking for module 'libpcre'
-- package 'libpcre' not found
CMake Error at /usr/local/share/cmake-2.8/Modules/FindPkgConfig.cmake:279 (message):
A required package was not found
Call Stack (most recent call first):
/usr/local/share/cmake-2.8/Modules/FindPkgConfig.cmake:333 (_pkg_check_modules_internal)
cmake/modules/FindPCRE.cmake:25 (pkg_check_modules)
CMakeLists.txt:11 (find_package)
安装如下依赖即可解决上面的两个问题
yum -y install glib2-devel mysql-devel zlib-devel pcre-devel
2:
cmake .
make
make install
尤其注意:由于Mydumper不处理MySQL的视图,触发器和存储过程,因此使用mydumper去导出schema并不可靠.
实际生产环境中,建议mydumper仅用于导出数据(使用--no-schemas),而通过mysqldump来导出schema.
一个简单的备份schema脚本:schemadump.sh
导出sql时mydumper肯定比mysqldump快,因为mydumper是多线程的!
下面就导入sql进行测试:
阅读(2045) | 评论(0) | 转发(0) |