dowbwrr3590709 2013-03-18 07:51
浏览 22
已采纳

MySQL加载文件无效的整数

I am trying to import the following CSV data into a fresh clean table with the below settings. And keep getting two entries added and then warnings. Why is it giving an error? I have changed it from Inno to MyISAM as I thought that might be the issue, but no luck.

16,"Data point 1"
15,"Data point 2"
14,"Point 3a"
13,"Data total"

After running this SQL

LOAD DATA LOCAL INFILE 'C:/Users/Me/CSV.csv' INTO TABLE points FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"' LINES TERMINATED BY ''

I get the following warning

2 row(s) affected, 2 warning(s): 1366 Incorrect integer value: ' 15' for column 'id' at row 2

The table is setup as follows.

id INT(11) Default 0 PK
value VARCHAR(45) Default NULL
  • 写回答

2条回答 默认 最新

  • donk68254 2013-03-18 08:08
    关注

    Maybe your lines are not actually terminated by , but instead? That would explain the whitespace character in Incorrect integer value: ' 15' – it would just be the .

    So try LINES TERMINATED BY ' ' instead.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)
编辑
预览

报告相同问题?

悬赏问题

  • ¥15 一部手机能否同时用不同的app进入不同的直播间?
  • ¥15 没输出运行不了什么问题
  • ¥20 输入import torch显示Intel MKL FATAL ERROR,系统驱动1%,: Cannot load mkl_intel_thread.dll.
  • ¥15 点云密度大则包围盒小
  • ¥15 nginx使用nfs进行服务器的数据共享
  • ¥15 C#i编程中so-ir-192编码的字符集转码UTF8问题
  • ¥15 51嵌入式入门按键小项目
  • ¥30 海外项目,如何降低Google Map接口费用?
  • ¥15 fluentmeshing
  • ¥15 手机/平板的浏览器里如何实现类似荧光笔的效果
手机看
程序员都在用的中文IT技术交流社区

程序员都在用的中文IT技术交流社区

专业的中文 IT 技术社区,与千万技术人共成长

专业的中文 IT 技术社区,与千万技术人共成长

关注【CSDN】视频号,行业资讯、技术分享精彩不断,直播好礼送不停!

关注【CSDN】视频号,行业资讯、技术分享精彩不断,直播好礼送不停!

客服 返回
顶部