Skip to content

Instantly share code, notes, and snippets.

@janetlee
Created February 7, 2018 00:45
Show Gist options
  • Save janetlee/f892f7e0ab2788cda5ab8b629558d29d to your computer and use it in GitHub Desktop.
Save janetlee/f892f7e0ab2788cda5ab8b629558d29d to your computer and use it in GitHub Desktop.
How to truncate a constrained table in MySQL
SET FOREIGN_KEY_CHECKS = 0;
TRUNCATE table $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