我在sql中找不到这个错误,有人可以帮忙吗?
1064 - 您的 SQL 语法有错误;检查与您的 MySQL 服务器版本相对应的手册,以在第 1 行的 'ID MEDIUMINT(9) NOT NULL AUTO_INCREMENT, datetimeTIMESTAMP, title TEXT NOT' 附近使用正确的语法
CREATE TABLE tableName1 (
ID MEDIUMINT(9) NOT NULL AUTO_INCREMENT,
timestamp TIMESTAMP NOT NULL,
title TEXT NOT NULL,
titleEdited TEXT,
description TEXT NOT NULL,
descriptionEdited TEXT,
URL VARCHAR(255) NOT NULL,
URLEdited VARCHAR(255),
imgPath VARCHAR(255) NOT NULL,
PRIMARY KEY (ID),
UNIQUE KEY (URL, imgPath)
)
CREATE TABLE tableName2 (
ID MEDIUMINT(9) NOT NULL AUTO_INCREMENT,
linkID MEDIUMINT(9) NOT NULL,
timestamp TIMESTAMP NOT NULL,
comment TEXT NOT NULL,
userID BIGINT(20) NOT NULL,
PRIMARY KEY(ID),
FOREIGN KEY(linkID) REFERENCES tableName1(ID),
FOREIGN KEY(userID) REFERENCES users(ID)
)