跟着别人的视频学习创建一个表,运行的时候一直报错
create table user(
id int primary key auto_increment comment '主键',
name varchar(10) not null unique comment '名字',
age char(1) check ( age > 0 && age < 120 ) comment '年龄',
status char(1) default '1' comment '状态',
gender char(1)
) comment '用户表';
报错内容:42000][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 'comment '年龄', status char(1) default '1' comment '状态', gender ' at line 4
将comment '年龄'注释掉后程序能正常运行
想请教一下各位,这是怎么回事?
数据库版本不一致,你看的视频应该是8.0的,但你数据库是低于8.0的