Shell导出MySql部分表及数据

来源:互联网 发布:龙虎榜数据哪里查询 编辑:程序博客网 时间:2024/05/01 00:54
#!/bin/bash
#export MySql table and table's data
#table's name in single file,shell to read this file and read by line
#shell script by okhelper ,2016-02-26


cat $1 | while read LINE            
do
        CMD="mysqldump -h 127.0.0.1 -uroot -proot fsdb $LINE"
        echo $CMD
        #sleep 1
        eval $CMD |tee $LINE.sql
        #sleep 1
done


echo ""
echo "backup fsdb's table complet!"
0 0