i turn off the checks before a dump in order to restore it properly.
In my scripts looks like:
echo SET FOREIGN_KEY_CHECKS=0;
${mysql_backup_directory}/${2}/${database_filename}
mysqldump --opt -h $2 -P $3 -u $db_username --password=$db_password $1
Stephen,
in = 4.0, you should put
SET FOREIGN_KEY_CHECKS=0;
at the start of the dump file.
In 4.1, mysqldump knows to add to a dump file a line
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS,
FOREIGN_KEY_CHECKS=0*/
to disable foreign key checks in the dump file.
Best regards,