Last active
April 21, 2018 02:17
-
-
Save buithehoa/9e503b886436e3f60691 to your computer and use it in GitHub Desktop.
Truncate all MySQL tables
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT Concat('TRUNCATE TABLE ',table_schema,'.',TABLE_NAME, ';') FROM INFORMATION_SCHEMA.TABLES where table_schema in ('database_name'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment