#1064-您的SQL语法有误;检查与您的MySQL服务器版本相对应的手册,以在')'附近使用正确的语法 [英] #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 ')'
本文介绍了#1064-您的SQL语法有误;检查与您的MySQL服务器版本相对应的手册,以在')'附近使用正确的语法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
这是代码.但是我一直收到这个错误
This is the code. However I kept getting this error
1064-您的SQL语法有错误;检查与您的MySQL服务器版本相对应的手册,以找到在第7行的')'附近使用的正确语法
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 ')' at line 7
奇怪的是,第7行是CREATE TABLE academicnews( line. Which does not contain ')'
.
CREATE TABLE academicnews(
anewsID INT NOT NULL PRIMARY KEY AUTO_INCREMENT,
title VARCHAR(50) NOT NULL,
anewsContent TEXT NOT NULL,
imagePath VARCHAR(200) NOT NULL,
timeNews DATE NOT NULL,
); #Line 7
推荐答案
删除最后一个逗号.这是不必要和无效的.
Get rid of the last comma. It is unnecessary and invalid.
CREATE TABLE academicnews(
anewsID INT NOT NULL PRIMARY KEY AUTO_INCREMENT,
title VARCHAR(50) NOT NULL,
anewsContent TEXT NOT NULL,
imagePath VARCHAR(200) NOT NULL,
timeNews DATE NOT NULL, <-- HERE
);
应该是
CREATE TABLE academicnews(
anewsID INT NOT NULL PRIMARY KEY AUTO_INCREMENT,
title VARCHAR(50) NOT NULL,
anewsContent TEXT NOT NULL,
imagePath VARCHAR(200) NOT NULL,
timeNews DATE NOT NULL
);
这篇关于#1064-您的SQL语法有误;检查与您的MySQL服务器版本相对应的手册,以在')'附近使用正确的语法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文