MySQL dump import -> Error 1217

Posted December 20, 2004 by dionak in 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.

The Conversation

Follow the reactions below and share your own thoughts.