imgotop
注册会员

UID 80935
精华
0
积分 195
帖子 127
金钱 195 喜悦币
威望 0
人脉 0
阅读权限 20
注册 2006-10-3 来自 福建
状态 离线
|
定义外键时出现1064 错误
post表和categories表我已经定义为使用InnoDB引擎;
post表中的post_category我已经建立了索引(INDEX);
但在post表中使用sql语句'FOREIGN KEY (`post_category`) REFERENCES categories (`cat_id`) ON DELETE CASCADE' 定义外键时还是出现如下错误
#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'FOREIGN KEY (`post_category`) REFERENCES categories (`cat_id`) ON DELETE CASCADE' at line 1
|  小 黄 |
|