insert報錯1366
seckill 也一直報錯說只能有一個timestamp我把創建時間放到開啟時間的前面就沒事了
但是下面的insert語句報錯 ?又是什么原因 ?好郁悶的啊
不正確的字符串值:“\ xC3 \ xEB \ xC9 \ xB1ip…“列”的名字在第一行
seckill 也一直報錯說只能有一個timestamp我把創建時間放到開啟時間的前面就沒事了
但是下面的insert語句報錯 ?又是什么原因 ?好郁悶的啊
不正確的字符串值:“\ xC3 \ xEB \ xC9 \ xB1ip…“列”的名字在第一行
2017-01-22
舉報
2017-07-06
我是用cmd也會出現這種錯誤,應該是編碼格式的問題,之后我用navicat插入數據就可以了!你試試
2017-01-30
我用的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;