Skip to content

Instantly share code, notes, and snippets.

@sylvaincombes
Created September 2, 2014 10:40
Show Gist options
  • Save sylvaincombes/c0795cd07d3c641a7bc6 to your computer and use it in GitHub Desktop.
Save sylvaincombes/c0795cd07d3c641a7bc6 to your computer and use it in GitHub Desktop.
Mysql disable foreign key
-- disable
SET FOREIGN_KEY_CHECKS = 0;
-- truncate for example
TRUNCATE mytable;
-- enable
SET FOREIGN_KEY_CHECKS = 1;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment