Mysql 删除多个表

Mysql 删除多个表,mysql,Mysql,如何在MySQL数据库中删除多个表。 (表格后缀相同)请告诉我一些想法 我试图删除多个具有相同后缀00000的表 我提出的问题是 Drop table Like '%00000'; 您可以创建一个过程 drop procedure if exists droplike; delimiter // create procedure droplike(pattern varchar(20)) begin set group_concat_max_len = 65535; select @

如何在MySQL数据库中删除多个表。 (表格后缀相同)请告诉我一些想法

我试图删除多个具有相同后缀00000的表

我提出的问题是

Drop table Like '%00000'; 

您可以创建一个过程

drop procedure if exists droplike;
delimiter //
create procedure droplike(pattern varchar(20))
begin
  set group_concat_max_len = 65535;
  select @drop:= concat( 'drop table ', group_concat(table_name) , ';' ) from information_schema.tables where table_schema = "database_name" and table_name like pattern;
  prepare statement from @drop;
  execute statement;
end //
delimiter ;
然后,调用下面的过程

call droplike("0000%");

您可以使用
显示数据库中的表,如“%00000”
,然后将粘贴复制到文本编辑器中,并构建一个逗号分隔的列表,以馈送
删除表。