I had foreign keys: `CONSTRAINT mailcoach_campaign_clicks_campaign_link_id_foreign FOREIGN KEY (campaign_link_id) REFERENCES mailcoach_campaign_links` The fix is to insert `SET FOREIGN_KEY_CHECKS=0;` at the beginning and `SET FOREIGN_KEY_CHECKS=1;` at the end of the SQL file.