开发者

Unable create a table - ERROR 1064 (42000): You have an error in your SQL syntax

开发者 https://www.devze.com 2022-12-29 13:44 出处:网络
I\'m trying to execute this simple command: create table foo (clo int primary key unsigned auto_increment);

I'm trying to execute this simple command:

create table foo
(clo int primary key unsigned auto_increment);
开发者_开发技巧

But I get this error:

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 'unsigned auto_increment)' at line 2


I tried putting int and unsigned together and it worked fine:

create table foo
(clo int unsigned primary key auto_increment );


Your syntax is a little off. Try this:

create table `foo` (
  `clo` int unsigned auto_increment ,
  PRIMARY KEY(`clo`)
) ENGINE=MYISAM AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号