Force drop mysql bypassing foreign key constraint

后端 未结 6 772
别跟我提以往
别跟我提以往 2021-01-29 18:08

I\'m trying to delete all tables from a database except one, and I end up having the following error:

Cannot delete or update a parent row: a foreign key

6条回答
  •  盖世英雄少女心
    2021-01-29 18:53

    If you are using phpmyadmin then this feature is already there.

    • Select the tables you want to drop
    • From the dropdown at the bottom of tables list, select drop
    • A new page will be opened having checkbox at the bottom saying "Foreign key check", uncheck it.
    • Confirm the deletion by accepting "yes".

提交回复
热议问题