问题描述
- 求解 mysql数据库第三行错误 birthday
-
create table user
(
id int primary key aotu_increment,
name varchar(40),
password varchar(40),
email varchar(40),
birthday date
)character set utf8 collate utf8_general_ci;
insert into user(name,password,eamil,birthday) values('zs','123456','zs@sina.com','1980-12-04');
insert into user(name,password,eamil,birthday) values('lisi','123456','lisi@sina.com','1981-12-04');
insert into user(name,password,eamil,birthday) values('wangwu','123456','wangwu@sina.com','1979-12-04');
解决方案
create table user
(id
int primary key AUTO_INCREMENT,name
varchar(40),password
varchar(40),email
varchar(40),birthday
date
)character set utf8 collate utf8_general_ci;
insert into user
(name
,password
,email
,birthday
) values('zs','123456','zs@sina.com','1980-12-04');
email 不是eamil
而且mySql里面用的都是二楼说的1左边的那个符号
解决方案二:
password是关键字,需要转义
->
`password`
解决方案三:
注意是数字1左边的那个符号,不是单引号
解决方案四:
补充下,上面每个红字都要加上1左边的那个符号
时间: 2024-09-19 06:09:18