ERROR 1451 (23000): Cannot delete or update a parent row: a foreign key constraint fails
如何克服这个问题?
UPDATE table1 SET reference=NULL; DELETE FROM table2 WHERE id=1; DELETE FROM table1 WHERE id=1;
通过清除引用,FK约束不再是问题.