Mysql batch deletes table prefixes or suffixes, and mysql batch deletes tables
Oracl has the usage of drop table like, but mysql does not. You can write scripts (not to repeat them) or assemble SQL statements.
Note: My database name is test and there is a table named data. Then I prepare four tables with the same prefix and delete them in batches. This SQL statement can be used to prepare data.
Create table test_1201 SELECT * FROM 'data ';
Create table test_1202 SELECT * FROM 'data ';
Create table test_1203 SELECT * FROM 'data ';
Create table test_1205 SELECT * FROM 'data ';
Select concat ('drop table', GROUP_CONCAT (table_name), ';') AS statement FROM information_schema.tables WHERE table_schema = 'test' AND table_name LIKE 'test _ 100 ';
The preceding SQL statement displays an SQL result. You can run the preceding SQL result on one side.
(Change table_schema (this is the database name) and table_name (this is the name of the data table)
Drop table test_1201, test_1202, test_1203;
Create a delete script first
Run the following statement:
Select 'drop table' + name from sysobjects where type = 'U' and name like 'B %'
The query results are displayed, and the query results are copied.
Then run the copied query results in database 123.
Mysql Database SQL statements batch delete data tables with the same prefix
You can also use the client to delete mysqlfront, phpadmin...