Skip to content

Instantly share code, notes, and snippets.

@madebyallie
Created June 22, 2015 09:35
Show Gist options
  • Select an option

  • Save madebyallie/c003e9e820aaf56b6fc1 to your computer and use it in GitHub Desktop.

Select an option

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