我试图通过以下代码了解解析错误的原因(1064)。
<#1064 - 您的SQL语法出错了;检查手册 对应于您的MySQL服务器版本,以便使用正确的语法 靠近''在第3行>
CREATE TABLE Party_Library
(
Party INT(11)
Library varchar(40)
PRIMARY KEY (Library,Party)
FOREIGN KEY (Party) REFERENCES Party(PartyKey) ON DELETE CASCADE
FOREIGN KEY (Library) REFERENCES MusicLibraries(MusicSource) ON DELETE CASCADE
)
答案 0 :(得分:0)
每个声明后都缺少逗号:
CREATE TABLE Party_Library
(
Party INT(11),
Library varchar(40),
PRIMARY KEY (Library,Party),
FOREIGN KEY (Party) REFERENCES Party(PartyKey) ON DELETE CASCADE,
FOREIGN KEY (Library) REFERENCES MusicLibraries(MusicSource) ON DELETE CASCADE
);