Skip to content

Instantly share code, notes, and snippets.

@buithehoa
Last active April 21, 2018 02:17
Show Gist options
  • Save buithehoa/9e503b886436e3f60691 to your computer and use it in GitHub Desktop.
Save buithehoa/9e503b886436e3f60691 to your computer and use it in GitHub Desktop.
Truncate all MySQL tables
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