Skip to content

Instantly share code, notes, and snippets.

@madebyallie
Created June 22, 2015 09:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save madebyallie/c003e9e820aaf56b6fc1 to your computer and use it in GitHub Desktop.
Save madebyallie/c003e9e820aaf56b6fc1 to your computer and use it in GitHub Desktop.
SQL statement to truncate a MySQL table that has foreign keys
SET FOREIGN_KEY_CHECKS = 0;
TRUNCATE table_name;
SET FOREIGN_KEY_CHECKS = 1;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment