博主辛苦了,我要打赏银两给博主,犒劳犒劳站长。
【摘要】昨天使用 navicate for mysql 导入出现了这么一个错误 [Err] 1136 - Column count doesn't match value count at row 1 ,然后我以为是自己拼写错误了呢,本文介绍一下遇到这样错误的原因。
昨天的一条 SQL 插入语句:
INSERT INTO mallc_goods(goods_id,goods_msds_file,goods_commonid,goods_name,goods_jingle,goods_period,store_id,store_name,gc_id,gc_id_1,gc_id_2,gc_id_3,brand_id,goods_price,goods_promotion_price,goods_promotion_type,goods_marketprice,goods_serial,goods_storage_alarm,goods_click,goods_salenum,goods_collect,goods_spec,goods_storage,goods_image,goods_state,goods_verify,goods_addtime,goods_edittime,areaid_1,areaid_2,color_id,transport_id,goods_freight,goods_commend,goods_stcids,evaluation_good_star,evaluation_count,is_virtual,virtual_indate,virtual_limit,virtual_invalid_refund,is_fcode,is_appoint,is_presell,have_gift,is_own_shop);
咋一看是没有什么问题,然后却报错了:
[Err] 1136 - Column count doesn't match value count at row 1
后来经过反复的对比发现,values 值少了一个,所以才报了这样的错误。
后来经过我的测试,发现只要是字段缺少或者增多一个,都会导致这个问题:
[Err] 1136 - Column count doesn't match value count at row 1
例子:一个学生表:
使用
mysql> use test;
Database changed
mysql> insert into student(name,age) values('mafutian',18,1);
1136 - Column count doesn't match value count at row 1
mysql> insert into student(name,age) values('mafutian',18,1,2);
1136 - Column count doesn't match value count at row 1
mysql> insert into student(id,name,age) values('mafutian',18);
1136 - Column count doesn't match value count at row 1
mysql> insert into student(id,name,age) values('mafutian',18);
版权归 马富天PHP博客 所有
本文标题:《[Err] 1136 - Column count doesn't match value count at row 1 的解决办法》
本文链接地址:http://www.mafutian.net/223.html
转载请务必注明出处,小生将不胜感激,谢谢! 喜欢本文或觉得本文对您有帮助,请分享给您的朋友 ^_^
顶0
踩0
评论审核未开启 |