并非所有行都从CSV文件导入MySQL Workbench吗?

发布于 2025-02-06 07:00:25 字数 980 浏览 4 评论 0 原文

我是一个新的SQL学习者,并且在尝试将CS​​V文件导入MySQL Workbench时遇到问题。

CSV文件具有541909行,但是当将其导入MySQL时,仅导入大约35000行,我使用Count命令知道数字差异。

在导入过程中没有显示错误,在首选项设置中,我什至更改为1000000限制行。我正在使用MacBook。

以下是我的表查询并链接到我的CSV文件

(原始文件是xlsx,但我将其更改为CSV文件)

cdv的链接

但它仅导入500,000多行中的76318行。这就是为什么我被困。这是CSV链接文档

。先感谢您。

SQL查询:

CREATE TABLE Online_Retail (
    InvoiceNo   VARCHAR(100),
    Stock_Code  VARCHAR(50),
    Description TEXT,
    Quantity DECIMAL,
    Invoice_Date DATE,
    Unit_Price  DECIMAL,
    Customer_ID VARCHAR(50),
    Country VARCHAR(100)
);

I’m a new SQL learner and I’m having problems while trying to import CSV file into MySQL Workbench.

The CSV file has 541909 Rows but when it is imported into MySQL, only around 35000 rows are imported and I knew the number difference by using the COUNT command.

No error is shown during the import process and I even changed to 1000000 limit rows in the preference setting. I’m using MacBook.

Below is my table query and link to my CSV file

https://archive.ics.uci.edu/ml/machine-learning-databases/00352/

(Original file is xlsx but I changed it to a CSV file)

Link for the cdv is
https://docs.google.com/spreadsheets/d/1EyZ9JrlsXcAxQz5BdAXTDVYjSLy25ZWOE1fpv0jDjxM/edit?usp=sharing

yet it only imports 76318 rows out of over 500,000 rows. That's why I am stuck. Here is csv link docs.google.com/spreadsheets/d/

Any idea of resolving this issue is highly appreciated. Thank you in advance.

SQL query:

CREATE TABLE Online_Retail (
    InvoiceNo   VARCHAR(100),
    Stock_Code  VARCHAR(50),
    Description TEXT,
    Quantity DECIMAL,
    Invoice_Date DATE,
    Unit_Price  DECIMAL,
    Customer_ID VARCHAR(50),
    Country VARCHAR(100)
);

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

谁与争疯 2025-02-13 07:00:25

向其他面临问题的人发布答案。我不建议使用MySQL Workbench导入向导,它不会说明错误。我尝试删除逗号,任何空间,但没有解决问题。

最简单的方法是

  1. 使用任何在线convertor(例如convertcsv.com)将csv转换为.sql文件(对于convertcsv.com,输入表名称,忽略输出选项,保留所有默认选项)。最后对步骤4进行快速检查:生成输出以查看是否将其插入右表)

  2. 使用命令行mysql -u -p< filename.sql

Posting the answer late for others facing the problem. I would not suggest to use the MYSQL workbench import wizard, it doesn't tell the errors. I tried removing commas, any spaces but didn't solve the problem.

The easiest way is

  1. Convert CSV to .sql file using any online convertor like convertcsv.com (For convertcsv.com enter table name, ignore output options, keep all default options checked). Finally do a quick check on Step 4: Generate output to see if it is inserting into the right table)

  2. Import using command line mysql -u -p < filename.sql

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文