我已经看到了几个关于这个错误的问题,并尝试了所有建议的解决方案,但都没有成功。
我正在运行一个 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
我需要你的专家帮助。