简体   繁体   English

使用 Python 将大型 excel 文件导入 Mysql DB

[英]import large excel file into Mysql DB using Python

Dear "never give up" fellow,亲爱的“永不放弃”的伙伴,

After 3 weeks trying to find out a solution, I give up and request your assistance on the following.经过 3 周的努力寻找解决方案后,我放弃并请求您在以下方面提供帮助。

I am trying to create a mysql db (done), a table (done) and import an excel file into the created DB (failed) using python (I could use workbench but I decided I must do it in python)我正在尝试创建一个 mysql 数据库(完成),一个表(完成)并将 excel 文件导入到创建的数据库中(失败),使用 python 它在 python 中必须使用工作台(我可以决定)

the code is available here (hope it works as this is the first time I use github)代码在这里可用(希望它可以工作,因为这是我第一次使用 github)
https://github.com/LucTiber/GLBPRS20200412/tree/master https://github.com/LucTiber/GLBPRS20200412/tree/master
The error I am getting is:我得到的错误是:

TypeError: "<" not supported between instances of "str" and "float" error message in full can be found on the git page too TypeError: "<" not supported between "str" and "float" 完整的错误消息也可以在 git 页面上找到

I review both the raw and transformed files and could not find any string...我查看了原始文件和转换后的文件,但找不到任何字符串...

Any clue is more then welcome任何线索都更受欢迎

Side note for those who are prompt to -1: we are all trying to learn by trying and sometimes it means asking for help from more skillful and ready to share.对于那些提示-1的人的旁注:我们都在尝试通过尝试来学习,有时这意味着向更有技巧和准备分享的人寻求帮助。 So be open minded and ready to help.所以要思想开放,随时准备提供帮助。 Thanks !谢谢 !

I finally figured out why it was note working MySQL does not like empty dates even if empty is allowed我终于明白了为什么注意到工作 MySQL 不喜欢空日期,即使允许空日期

Fill the empty cells with fake dates like 12/21/2999 and it should work用 12/21/2999 之类的假日期填充空单元格,它应该可以工作

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM