[Answered ]-Drop tables in database used by django

2đź‘Ť

âś…

Two possibilities:

  1. There is a table within another schema (“database” in mysql terminology) which has a FK reference
  2. The innodb internal data dictionary is out of sync with the mysql one.

You can see which table it was (one of them, anyway) by doing a “SHOW ENGINE INNODB STATUS” after the drop fails.

If it turns out to be the latter case, I’d dump and restore the whole server if you can.

MySQL 5.1 and above will give you the name of the table with the FK in the error message.

and try this too

Please refer this question stackoverflow

Disable foreign key checking

DISABLE KEYS

Do make sure to SET FOREIGN_KEY_CHECKS=1;

👤Ghostman

0đź‘Ť

Instead of using default innodb storage engine you can easily configure django to use MyISAM. In the later case, it wouldn’t restrict you from performing various operation because of the relationships. Both have their positive and negative points.

Leave a comment