---
title: "在mysql中删除前缀是delete的所有表"
author: "strutsliu"
date: "2011-04-14T16:49:54Z"
tags: []
categories: ["数据库"]
slug: "mysql-delete"
draft: false
lastmod: "2011-04-14T16:53:24Z"
id: 1003195
url: "https://strutsliu.iteye.com/blog/1003195"
---

use bitrac//choose database
DROP TABLE IF EXISTS `enter_delete`;
CREATE TABLE `enter_delete` (
  `id` int(11) NOT NULL auto_increment,
  `run` char(255) collate utf8_bin default NULL,
  PRIMARY KEY  (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;


INSERT INTO enter_delete (run)
SELECT   CONCAT( 'drop table ',table_name,'; ')   FROM   

information_schema.tables where information_schema.tables.TABLE_NAME 

LIKE 'delete_%' ;


select   run   from   bitrac.enter_delete   into   outfile   

"C\:delete.sql ";



source c:delete.sql

参考资料
http://zhidao.baidu.com/question/93897501.html
http://blog.sina.com.cn/s/blog_414ef1950100lkyf.html