mydumper与mysqldump使用

(1) 使用mysqldump 备份 30M
 mysqldump -u root -p kk > /tmp/mysql.bak #5 sec
mysql -u root -p kk < /tmp/mysql.bak # 9 sec
(2)使用mydumper,myload进行备份还原
1 Requirements  
yum install gcc gcc-c++ glib2-devel mysql-devel zlib-devel pcre-devel -y
rpm -ivh cmake-2.6.4-7.el5.i386.rpm
 
2 install 
tar fvxz mydumper-0.2.3.tar.gz
cd mydumper-0.2.3
cmake .
make
make install
 
3  op
mkdir -pv /tmp/sqlbak
mkdir: 已创建目录 “/tmp/sqlbak”
chown mysql.mysql sqlbakmy
 
mydumper -B databasename -u root -p password -h hostip -o /tmp/sqlbak  -r  100000          # 5 sec
myloader -u root -p password -d /tmp/sqlbak  -B databasename
 

你可能感兴趣的:(mydumper,mysqldum)