0

Error 1217: Cannot delete or update a parent row: a foreign key constraint fails SQL Statement: drop table s_a_user.main

i used "rpl -Ris ..." to check the sql dumps, and it's not in there. i queried the information schema, and it's not in there either. i think this is a bug, but i may just not be finding an elusive reference to this table. screenshot below shows all info needed.

http://tinypic.com/r/30lcu2t/6 - they resized it and it's hard to read, but the tables listed are s_a_user.resume, not s_a_user.main, so, in other words, it confirms there is nothing referencing this

==UPDATE==SOLVED==

this is a bug in mysql. "SHOW ENGINE INNODB STATUS" shows the error came from "s_a_mail.topic", which does not even exist [-_-] ...

to solve this: delete all innodb log files, delete the schema, delete the schema's directory, restart mysql with innodb_force_recovery=4 in your my.conf, remove the force recovery, restart mysql again, recreate the database schema, reimport the data backup, restart mysql with innodb_force_recovery=4 AGAIN, take out innodb_force_recovery=4 and restart AGAIN.

this fixes the foreign key problem, but now workbench crashes when accessing the s_a_user schema's tables, so now i get to investigate that... [-_-] i'm about to just build a new database system...

4

1 回答 1

0
SET FOREIGN_KEY_CHECKS=0; DROP TABLE ´your_table´; SET FOREIGN_KEY_CHECKS=1;

这应该可以帮助你。

Rune Kaagaard这个问题上的技巧

于 2016-01-13T17:41:48.587 回答