seckill 也一直报错说只能有一个timestamp我把创建时间放到开启时间的前面就没事了
但是下面的insert语句报错 又是什么原因 好郁闷的啊
不正确的字符串值:“\ xC3 \ xEB \ xC9 \ xB1ip…“列”的名字在第一行
我是用cmd也会出现这种错误,应该是编码格式的问题,之后我用navicat插入数据就可以了!你试试
我用的mysql workbench没出现你那个问题啊
SQL 如下
create database seckill;
use seckill;
create table seckill(
`seckill_id` bigint NOT NULL auto_increment comment 'bank save count',
`name` varchar(120) not null comment 'name',
`number` int not null comment 'asdf',
`start_time` timestamp not null comment 'time',
`end_time` timestamp not null comment '',
`create_time` timestamp not null default current_timestamp,
primary key(seckill_id),
key idx_start_time(start_time),
key idx_end_time(end_time),
key idx_create_time(create_time)
)engine=InnoDB AUTO_INCREMENT=1000 DEFAULT CHARSET=utf8;
insert into seckill(name,number,start_time,end_time)
values
('1000 iphone6', 100,'2016-11-11 00:00:00','2016-11-12 00:00:00'),
('1000 ipad2', 100,'2016-11-11 00:00:00','2016-11-12 00:00:00');
create table success_killed(
`seckill_id` bigint NOT NULL,
`user_phone` bigint not null,
`state` int not null default -1,
`create_time` timestamp not null,
primary key(seckill_id,user_phone),
key idx_create_time(create_time)
)engine=InnoDB AUTO_INCREMENT=1000 DEFAULT CHARSET=utf8;
commit;