SET FOREIGN_KEY_CHECKS=0;

Seems to be the solution.