Skip to content

Instantly share code, notes, and snippets.

@Svel
Created September 9, 2012 11:08
Show Gist options
  • Select an option

  • Save Svel/3683829 to your computer and use it in GitHub Desktop.

Select an option

Save Svel/3683829 to your computer and use it in GitHub Desktop.
Commands to recover MySQL dump for InnoDB with FK
---# mysqldump -uUser -hHost -p database > database.sql
---# mysql -D database -uUser -p --init-command="set @@foreign_key_checks=0" < database.sql
SET FOREIGN_KEY_CHECKS=0 ;
use database ;
source database.sql ;
SET FOREIGN_KEY_CHECKS=1 ;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment