To temporarily turn off Referential Integrity, add this to the top of some SQL statements
SET FOREIGN_KEY_CHECKS = 0;
Then set to 1 to turn it back on.
Reference: http://stackoverflow.com/questions/9957878/mysql-disable-referential-integrity