Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
错误:此查询只是插入文件的 1 行
LOAD DATA INFILE 'file.csv' INTO TABLE coords FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n';
该文件有 300k 行。
列用逗号分隔。
是如何coords创建的?它有 10 个数据属性吗?
coords
我刚刚对包含六个相同行的文件(使用您的数据)进行了快速测试,然后输入:
LOAD DATA LOCAL INFILE 'file.csv' INTO TABLE coord FIELDS TERMINATED BY ',' LINES TERMINATED BY '\n';
它读取了所有 6 行。
我在 Linux 下做到了这一点。如果您使用的是 Windows,则可能需要 '\r\n' (?)。