Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MovieGenre3.csv无法导入数据库的问题 #26

Open
letsgopy opened this issue Dec 12, 2021 · 6 comments
Open

MovieGenre3.csv无法导入数据库的问题 #26

letsgopy opened this issue Dec 12, 2021 · 6 comments

Comments

@letsgopy
Copy link

用Navicat或者用python处理csv,均不能正确将csv数据导入到数据库表。分析可能存在的问题:

  1. csv文件格式问题,用文本编辑器打开,发现每行数据末尾是“,,”,而不是"\r\n"
  2. img的内容包含",” 但是按道理整个超链接外部是被双引号包住的应该不存在分隔符冲突;
    3.imdbID数据中,有一些电影名是乱码,在pycharm里用sql命令导入时,报编码错误,怀疑存在编码问题。SQL命令如下:"load data infile 'csv文件/MovieGenre3.csv' into table moviegenre3 fields terminated by ',' lines terminated by '\n' (userId,imdbId,poster);"
    有没有导入成功的小伙伴提供一些解决思路,谢谢
@chicig
Copy link

chicig commented Apr 9, 2022

你好,想问一下你解决了吗

@letsgopy
Copy link
Author

letsgopy commented Apr 15, 2022 via email

@letsgopy
Copy link
Author

letsgopy commented Apr 15, 2022 via email

@StackChan
Copy link

我使用pycharm的database功能导入,是完全没有问题的
(2022.08.10,pycharm版本:2022.2)

@YukiAIR
Copy link

YukiAIR commented Dec 4, 2023

我使用pycharm的database功能导入,是完全没有问题的 (2022.08.10,pycharm版本:2022.2)

请问你最后跑出来了吗

@hacker-xzb
Copy link

我解决了,是编码问题,用notepad++把编码改为utf-8就ok了

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants