我已经看到了有关此错误的几个问题,并尝试了所有建议的解决方案但没有成功。
我正在运行一个python脚本来将xml解析为csv文件,然后将其加载到MySQL数据库。其他每一步都顺利进行,成功连接。但是数据加载失败,出现以下错误。
[Extracted .xml. Time:4.34389615059]
- Starting write .csv
[Written CSV files. Cost:0.208467006683]
[Finishing processing one .zip package! Time consuming:16.2964661121]
[Process 6000 is finished. Cost Time:8763.27494121]
[Finished all xml4 files]
== Parseing Cost:9802.73910308 ==
- Starting load CSV files.
Connected successfully!()
***** PUBLICATION *****
Traceback (most recent call last):
File "PublicationsParser.py", line 931, in <module>
po.loadCSV()
File "PublicationsParser.py", line 691, in loadCSV
""".format(filePath=self.csvPath_publication.replace('\\','/')))
File "/home/phesto/Downloads/Documents/USPTO/MySQLProcessor.py", line 39, in load
self._cursor.execute(sql)
File "/usr/local/lib/python2.7/dist-packages/MySQL_python-1.2.4b4-py2.7-linux- i686.egg/MySQLdb/cursors.py", line 202, in execute
self.errorhandler(self, exc, value)
File "/usr/local/lib/python2.7/dist-packages/MySQL_python-1.2.4b4-py2.7-linux- i686.egg/MySQLdb/connections.py", line 36, in defaulterrorhandler
raise errorclass, errorvalue
_mysql_exceptions.InternalError: (13, "Can't get stat of '/home/phesto/Downloads/Documents/USPTO/CSV_P/publications.csv' (Errcode: 13)")
我正在使用Ubuntu 12.04
mysql Ver 14.14 Distrib 5.5.31, for debian-linux-gnu (i686) using readline 6.2
这是文件夹的文件权限,对于此文件夹的所有内容都是相同的
drwxrwxrwx 2 root phesto 4096 Apr 25 02:54 CSV_P
我尝试过没有本地的LOCAL INFILE和INFILE。
我还将此路径添加到apparmour mysqld / home / phesto / Downloads / Documents / USPTO / * rw,
Python代码在这里http://abel.lis.illinois.edu/upet/download.php
我需要你的专家帮助。
答案 0 :(得分:0)
所有父/上层文件夹也必须是MySQL可读的。