您的位置:首页 > 运维架构 > Shell

Shell导出MySql部分表及数据

2016-02-26 13:32 316 查看
#!/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!"
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: