MYSQL中如何删除多个名字相似的表
时间:2009-03-31 来源:johncan
转载的:
#!/bin/sh
MYSQLBIN="/usr/local/mysql/bin/mysql"
$MYSQLBIN -uroot -pxxx dbname -s -e "show tables like 'NTSWKDVL_%';" \
|sed 's/^/drop table /g' |sed 's/$/;/g' >/tmp/deletetable.sql
$MYSQLBIN -uroot -p123456 wordpress -s -e </tmp/deletetable.sql
#!/bin/sh
MYSQLBIN="/usr/local/mysql/bin/mysql"
$MYSQLBIN -uroot -pxxx dbname -s -e "show tables like 'NTSWKDVL_%';" \
|sed 's/^/drop table /g' |sed 's/$/;/g' >/tmp/deletetable.sql
$MYSQLBIN -uroot -p123456 wordpress -s -e </tmp/deletetable.sql
相关阅读 更多 +