[MySQL] TRUNCATE all tables in the database, print all TRUNCATE table statement

XXX will be replaced with the database name, and then execute SQL, the results will come out a copy of the database TRUNCATE can perform all the tables.

select CONCAT('truncate table XXX.',TABLE_NAME,';') FROM information_schema.TABLES WHERE TABLE_SCHEMA='XXXX';

Guess you like

Origin www.cnblogs.com/Jeely/p/11106163.html