软件安装:
# 下载工具 curl https://launchpad.net/mydumper/0.9/0.9.1/+download/mydumper-0.9.1.tar.gz # 安装依赖 yum install glib2-devel mysql-devel zlib-devel pcre-devel tar -xf mydumper-0.9.1.tar.gz cd mydumper-0.9.1 # cmake -CMAKE_INSTALL_PREFIX=/usr/local/mydumper cmake -DCMAKE_INSTALL_PREFIX=/usr/local/mydumper make make install # 配置环境变量略
导出数据:
# 导出数据 mydumper -B mall -o /home/tmp/mall -k -F 500 mydumper -B mall -o /home/tmp/mall -k -F 500 -h 192.168.0.205 -u root -p 111111 -B 数据库名 -o 输出目录 -k 不锁定数据表 -F 每个文件的大小(MB)
导入数据:
# 导入数据 myloader -t 8 -B mall -d /home/tmp/mall myloader -t 8 -B mall -d /home/tmp/mall -u root -p 111111 -t 线程数 -B 数据库 -d 数据文件