I am trying to clean out my database by deleting entries in certain tables. However, I am constantly getting a MySQL error message saying that I can’t do so.
Is there any way I can work around this?
#1451 - Cannot delete or update a parent row: a foreign key constraint fails (rayku_db.shout, CONSTRAINT shout_ibfk_1 FOREIGN KEY (poster_id) REFERENCES user (id))
try using the on delete cascade option, this will remove the orphan rows that would be left in another table with no parent for their foreign key. Are you sure, of course, that you want to delete these rows in the other table as well?