Home > Database > Mysql Tutorial > MySQL批量删除表_MySQL

MySQL批量删除表_MySQL

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-06-01 13:30:15
Original
1165 people have browsed it

bitsCN.com

MySQL批量删除表

 

mysql中没有现有的工具可以直接实现,所以原理就是使用现有的功能实现drop table 的语句的自动拼写,从而达到简化目的。

 

下边举例说明,如果想删除”wp_”开头的表:

 

1Select CONCAT( 'drop table ', table_name, ';' )2FROM information_schema.tables3Where table_name LIKE 'wp_%';
Copy after login

 

 

这样就会出现drop table wp_xxxx 的所有语句,复制下来,简单修改一下,直接粘贴到命令行中运行就可以了。

 

bitsCN.com
Related labels:
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Issues
MySQL stops process
From 1970-01-01 08:00:00
0
0
0
Error when installing mysql on linux
From 1970-01-01 08:00:00
0
0
0
phpstudy cannot start mysql?
From 1970-01-01 08:00:00
0
0
0
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template