shell把文件批量导入mysql

for file in ./tmp_data/*
do 
echo $file
mysql  -u'root' -p'wangbin' --default-character-set=utf8  -e"load data local infile '$file' into table yiche.yiche_core fields terminated by ',' lines terminated by '\n';"
rm -rf $file
done

 

posted @ 2017-07-26 10:20  Mars.wang  阅读(1748)  评论(0编辑  收藏  举报