没什么好办法,只能一个一个删除了。最多你是用脚本来得到所有的表名,然后如果表中有字段ID,则进行delete from
写个脚本,show tables from ...(你的库名),然后遍历表
用SP,取得所有表名,再用字符串累计生成SQL语句,动态执行
//先在数据库中找出 你的数据库(假设为 mytest)中所有的表select table_name from information_schema.clounms where table_schema = "mytest";如果你所有的表都有字段ID就可以查找字段为1的select ID from( select table_name from information_schema.clounms where table_schema = "mytest"; ) t where t.ID = 1;删除就是: delete t (select table_name from information_schema.clounms where table_schema = "mytest"; ) AS t where t.ID = 1;改下数据库的名字 你可以依次试试!
select table_name from information_schema.clounms where table_schema = "mytest";
) t where t.ID = 1;删除就是:
delete t (select table_name from information_schema.clounms where table_schema = "mytest";
) AS t where t.ID = 1;改下数据库的名字
你可以依次试试!