mysql delete all tables in database

-- Generate sql statement to delete all tables in xxx database
SELECT CONCAT('drop table ',table_name,';') FROM information_schema.`TABLES` WHERE table_schema='xxx';

-- Generate sql statements to query all tables in the xxxx database

SELECT CONCAT('select * from ',table_name,';') FROM information_schema.`TABLES` WHERE table_schema='xxx';

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325373671&siteId=291194637