初接触MYSQL,执行建表语句,报ERROR 1064 (42000):错误
create table forname
(
id int not null auto_increment,
first_name varchar(30) not null,
last_name varchar(30) not null
)
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 'm' at
line 6
请了解的同学指点下,谢谢额。。
貌似还是不行啊,执行了如下:
mysql> create table forname
-> (
-> id int not null primary key auto_increment,
-> first_name varchar(30) not null,
-> last_name varchar(30) not null
-> );
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 'm' at
line 6
朋友,你没按我说的改哦,就用这个吧
create table forname
(
id int primary key auto_increment,
first_name varchar(30) not null,
last_name varchar(30) not null
)
-----------------
你id的 not null没去掉,