日期:2014-05-16  浏览次数:21006 次

MySql 添加外键出错
alter table t_game add constraint fk_game_developer foreign key DeveloperId references t_developer(id);

出错:
ERROR 1064 (42000): 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 'refer
ences t_developer(id)' at line 1

------解决方案--------------------
alter table t_game add constraint fk_game_developer foreign key( DeveloperId) references t_developer(id);