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)
如何添加此FOREIGN KEY?
答案 0 :(得分:0)
尝试这种类型:
ALTER TABLE `aaaa` ADD CONSTRAINT fk_comp_id FOREIGN KEY ( `comp_id` ) REFERENCES `comps` ( `id` );
或者这个SO答案/问题可能会帮助您确定: Setting up foreign keys in phpMyAdmin?