批量删除某个前缀的表[MySQL]
由于本站点尝试过安装了BBS和其它一个博客,但又被我卸载了,现在想把这些有特殊前缀的表全部删掉。好像MySQL本身没有这个功能,所以找方法取而代之。
先运行下面的SQL语句:
select concat('drop table ', table_name, ';') from information_schema.tables where table_name like 'bbs_%';
然后得到一个drop table bbs_* 的列表,很简单了,到控制台跑一遍就可以了。
| Print article | This entry was posted by Herbert on 2009/04/09 at 11:15, and is filed under Database, Web. Follow any responses to this post through RSS 2.0. You can leave a response or trackback from your own site. |