将 .cvs 导入 MySQL 数据库时,某些数据在没有明显原因的情况下被修改,知道吗?

发布于 2024-09-19 19:36:20 字数 1080 浏览 2 评论 0原文

因此,我使用 phpMyAdmin 中的通过 LOAD DATA 导入 CVS 将 80000 多行 .cvs 文件导入到 MySQL 数据库,并且似乎工作正常,没有错误消息。

问题是,导入后,表中从第 24002 行开始的所有行在我的数据库字段之一中具有相同的编号,而该编号甚至不存在于我导入的 .cvs 文件中。

以此为例:

+-----------+-----------+-----------+
|id         |num 1      |num 2      |
+-----------+-----------+-----------+
|1          |03040304   |22222      |
|2          |03040305   |22223      |
|3          |03040306   |22224      |
|...        |...        |...        |
|24001      |03064304   |46222      |
|24002      |21777777   |46223      | <- 21777777 doesn't exist in my .cvs file
|24003      |21777777   |46224      |
|...        |...        |...        |
+-----------+-----------+-----------+

我尝试了不同的方法,但没有任何帮助:

  • 从第 24003 行开始导入,从 .cvs 文件中
  • 删除第 24001、24002 行,
  • 从 .cvs 文件中删除第 24002 行,
  • 导入 .cvs 文件而不加载数据

这是 .cvs 文件中的示例行:

"SOME NAME";"18/10/2004";"8250";"2157002001";"239423";"Done";"Name SURNAME"

不涉及特殊字符,仅包含 az、AZ 和 0-9。

我完全不知道这个错误可能来自哪里,有什么想法吗?

提前致谢

So I'm impoting a 80000+ lines .cvs files to a MySQL database, using Import CVS via LOAD DATA in phpMyAdmin, and it seems to work fine, there are no error messages.

Problem is, ater the import, all lines in the table, starting with line 24002 have the same number in one of my database fields, and this number doesn't even exist in the .cvs file I import.

Take this as an example:

+-----------+-----------+-----------+
|id         |num 1      |num 2      |
+-----------+-----------+-----------+
|1          |03040304   |22222      |
|2          |03040305   |22223      |
|3          |03040306   |22224      |
|...        |...        |...        |
|24001      |03064304   |46222      |
|24002      |21777777   |46223      | <- 21777777 doesn't exist in my .cvs file
|24003      |21777777   |46224      |
|...        |...        |...        |
+-----------+-----------+-----------+

I tried different things, but nothing helped:

  • starting the import at line 24003
  • removing the lines 24001, 24002 from the .cvs file
  • removing the 24002 first lines from the .cvs file
  • importing the .cvs file without LOAD DATA

This is an example line from the .cvs file:

"SOME NAME";"18/10/2004";"8250";"2157002001";"239423";"Done";"Name SURNAME"

There are no special characters involved, only a-z, A-Z and 0-9.

I have absolutely no clue where this error could come from, any ideas?

Thanks in advance

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

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

发布评论

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

评论(1

扮仙女 2024-09-26 19:36:20

数据库中“num 1”字段的定义是什么?是否为 int,因为 int 的最大值为 2,147,483,647,小于 2,157,002,001。

What is the definition for the "num 1" field in the database? Is it an int because the max value of an int is 2,147,483,647 which is less than 2,157,002,001.

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