[root@ evan]# mysql -uroot -pKK8,c3Rdt -h127.0.0.1 -P3307 -e " use dk_stat; show tables like 'log_role%'";
log_role_20160801
log_role_20160802
log_role
log_role_201609
log_role_201610
log_role_temp
分析 利用三重循环删除 分别删除 三种类型 单月 log_role_201601,单月加单日 log_role_20160801 和其它 log_role_20160811
#/bin/bash
#mytable=log_statdatas_20160
mytable=log_activate_20160
for tab0 in `seq 01 08`
do
for tab1 in `seq 1 9`
do
for tab2 in `seq 1 30`
do
mysql -uroot -p'KK8' -h127.0.0.1 -P3307 -e "use dk_stat; drop table ${mytable}${tab0}";
mysql -uroot -p'KK8' -h127.0.0.1 -P3307 -e "use dk_stat; drop table ${mytable}${tab0}0${tab1}";
mysql -uroot -p'KK8' -h127.0.0.1 -P3307 -e "use dk_stat; drop table ${mytable}${tab0}${tab2}";
done
done
done