NameSilo

MySQL won't let me delete rows

Spaceship Spaceship
Watch

dkr

Respect My Authority!VIP Member
Impact
43
Hi there,

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`))

erk8mt.png


Thanks!
 
0
•••
The views expressed on this page by users and staff are their own, not those of NamePros.
AfternicAfternic
0
•••
It is because that record relates to another record. Chances are, that is tables records is the one in a one-to-many relationship. This means that you need to delete the records on the many side first. Then you can delete the record you are trying to delete.
 
0
•••

We're social

Unstoppable Domains
Domain Recover
DomainEasy — Payment Flexibility
  • The sidebar remains visible by scrolling at a speed relative to the page’s height.
Back