MySQL dump import -> Error 1217

Contributor Icon Contributed by dionak  
Tag Icon Tagged: MySQL  

When using innodb tables and foreign key constraints, importing a mysqldump can sometimes generate foreign key errors.


Add to the beginning of the dump file: SET FOREIGN_KEY_CHECKS=0;

Add to the end of the dump file: SET FOREIGN_KEY_CHECKS=1;

This disables foreign key checks for the mysqldump import session only, allowing the data to be imported without the error being generated.

 

2 Comments -


No comments yet.

RSS feed for comments on this post. TrackBack URL

Leave a comment -