ERROR 1451 (23000): Cannot delete or update a parent row: a foreign key constraint fails

When deleting a table in a MySQL database, I get the following error message

To fix the error, run

Now the drop table SQL command will work. After you dropped the table, re-enable foreign key check with

Example

Need help with Linux Server or WordPress? We can help!

Leave a Reply

Your email address will not be published.