可能重複:
Setting up foreign keys in phpMyAdmin?錯誤在phpmyadmin中添加FOREIGN KEY?
ALTER table podcategory add FOREIGN KEY (category_id)
REFERENCES category(category_id)
ON UPDATE RESTRICT
ON DELETE CASCADE
當我在phpMyAdmin發送腳本中,我得到錯誤
Can't create table './C292729_T25027/#sql-be0_30ed238.frm' (errno: 150)
如何增加這個外鍵?
確保你的數據庫引擎是'InnoDB'和參考列爲'索引「列。檢查此答案[設置外鍵](http://stackoverflow.com/a/6244893/1225337) –
表有索引和InnoDb – Strannik