MYSQL建表时出现错误#1064 - You have an error in your SQL syntax;...
刚学MYSQL,第一次建表就出现错误真杯具:错误提示:#1064-YouhaveanerrorinyourSQLsyntax;checkthemanualthatcorr...
刚学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 ''tes1'( 'id' int(10) not null auto_increment, 'uid' varchar(10) not null defau' at line 1
代码如下:
CREATE TABLE 'test'(
'id' int( 10 ) NOT NULL AUTO_INCREMENT ,
'uid' varchar( 10 ) NOT NULL default '0',
'regdate' date NOT NULL ,
'remark' text,
PRIMARY KEY ( 'id' )
) ENGINE = InnoDB default CHARSET = gbk AUTO_INCREMENT =5; 展开
错误提示:
#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 ''tes1'( 'id' int(10) not null auto_increment, 'uid' varchar(10) not null defau' at line 1
代码如下:
CREATE TABLE 'test'(
'id' int( 10 ) NOT NULL AUTO_INCREMENT ,
'uid' varchar( 10 ) NOT NULL default '0',
'regdate' date NOT NULL ,
'remark' text,
PRIMARY KEY ( 'id' )
) ENGINE = InnoDB default CHARSET = gbk AUTO_INCREMENT =5; 展开
4个回答
展开全部
建表不用带'',还有,primary key,在mysql中,不是在后面加的,而是直接在字段后面加,正确的代码如下:
CREATE TABLE test(
id int( 10 ) NOT NULL PRIMARY KEY AUTO_INCREMENT ,
uid varchar( 10 ) NOT NULL default '0',
regdate date NOT NULL ,
remark text
) ENGINE = InnoDB default CHARSET = gbk AUTO_INCREMENT =5;
CREATE TABLE test(
id int( 10 ) NOT NULL PRIMARY KEY AUTO_INCREMENT ,
uid varchar( 10 ) NOT NULL default '0',
regdate date NOT NULL ,
remark text
) ENGINE = InnoDB default CHARSET = gbk AUTO_INCREMENT =5;
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
你你程序里面的单引号都取消
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
按照下面回答的输入怎么会出现error 1046 <3D000>:No database selected,求帮忙
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询