mysql数据库创建表出错误

来源:互联网 发布:前台数据传到msql乱码 编辑:程序博客网 时间:2024/06/05 15:40

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 'Group( GId int ,GCName varchar(20),GCSex varchar(10),GCIDCard int(20) not null p' at line 1

今晚上 执行这条语句时报错,

create table Group( GId int ,GCName varchar(20),GCSex varchar(10),GCIDCard int(20) not null primary key,          RoomId int,GCPhone int(20),foreign key (RoomId) references room(RoomId));



找了半天原因,原来是group是mysql的关键字,不能作为表名!!!谨记!

1 0