我想轻松删除多个表,而无需在删除查询中实际列出表名,并且要删除的表的前缀为“ wp_”
只需分享其中一种解决方案:
mysql> SELECT CONCAT(“ DROP TABLE”, GROUP_CONCAT(TABLE_NAME))as stmt 从information_schema.TABLES WHERE TABLE_SCHEMA =“ your_db_name”和TABLE_NAME像“ ur condition”进入输出文件’/tmp/a.txt’; mysql>源代码/tmp/a.txt;
mysql> SELECT CONCAT(“ DROP TABLE”, GROUP_CONCAT(TABLE_NAME))as stmt
从information_schema.TABLES
WHERE TABLE_SCHEMA =“ your_db_name”和TABLE_NAME像“ ur condition”进入输出文件’/tmp/a.txt’;
mysql>源代码/tmp/a.txt;