Ho trovato la soluzione, grazie cmq.

SET FOREIGN_KEY_CHECKS = 0;

SOURCE nomefile;

SET FOREIGN_KEY_CHECKS = 1;