簡體   English   中英

如何在MySQL中從不存在的表中刪除不存在的外鍵?

[英]How do I delete a foreign key that does not exist from a table that does not exist, in MySQL?

我試圖重命名InnoDB表中的主鍵,但我一直得到Errno150。SHOW INNODB STATUS顯示:

LATEST FOREIGN KEY ERROR
130711 18:22:53 Error in foreign key constraint of table xx/client_location_business_load:
there is no index in referenced table which would contain
the columns as the first columns, or the data types in the
referenced table do not match the ones in table. Constraint:
,
  CONSTRAINT "business_load_business_load_name_key" FOREIGN KEY ("name_id") REFERENCES "client_businesstype_load_name" ("name_id") ON DELETE CASCADE ON UPDATE CASCADE

client_location_business_load甚至不存在! 它被重命名。 名為business_load_business_load_name_key的約束也不存在,已被刪除並且它也沒有出現在information_schema.key_column_usage

有人知道這里發生了什么嗎?

您必須刪除數據庫並以相同的排序規則重新創建它。 似乎沒有其他選擇。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM