mysql批量删除表数据
时间:2021-07-01 10:21:17
帮助过:2人阅读
!/bin/
bash
### AUTHOR: Leo
### DATE: 2015/
09/
23
### REV: 1.0
echo -e
"Input the dbname you want to use: \c"
read db
mysql -uroot -ppro#pateo -e
"use $db;show tables;"|
grep -v Tables>
tb_in_$db.txt;
for tb
in `
cat tb_in_$db.txt`
do
echo $tb;
mysql -uroot -ppro#pateo -e
"use tas;delete from $tb;select * from $tb;"
echo ‘---------------------------------------‘;
done
rm -rf tb_in_$db.txt;
mysql批量删除表数据
标签: