Cannot delete or update a parent row: a foreign ke

Hi

MySQL version 5.5.54

I’ve tried to drop the tables DB of my 4.0.4, but I had this response:

"Failed to drop database : SQL drop table “llx_adherent` failed : Cannot delete or update a parent row: a foreign key constraint fails”

As I couldn’t drop just the tables I then delted the entierly DB, recreated it and went back to my oldest backup, from december 2016 and tried to drop just the tables, but with the same result. Until today I have never been in playing around directly with the DB; I have only used the Dolibarr interface.

I started with 3.8.3, I think, and have upgraded step by step to 4.0.4.

How do I solve this and what is the origin of the problem? Can it cause problems later on; bringing down the DB?

All the best

Hans

Hello

If you’re using phpMyAdmin then you need to ‘uncheck’ the tickbox for foreign key check (or something like that it is called).

Then all the tables or data will delete

Hi

Thanks. I used the database handler in Webmin and it does not have that function. Yeah, I could do it in phpmyadmin as well, but my worry is that it maybe is a sign of that something is wrong with the DB and I might have problems later on? Couldn’t this meessage be because something is wrong with the DB??

Hans