我正在使用PyMySQL-0.5.0并在将数据从文件加载到远程 MySQL 实例时面临一个模糊的错误/异常。在执行“加载数据本地 infile ...”语句时,我看到一个异常,上面写着:The used command is not allowed with this MySQL version
.
任何线索,如果 PyMySQL 完全支持此操作(和/或其他版本是否支持此操作)
PS:
1) 错误详情:
2012-05-17 11:05:24,524 - 8988 - DEBUG - Loading table table_2012_05_16
from file: /path/to/data/file_2012-05-16
2012-05-17 11:05:24,524 - 8988 - DEBUG - Executing update: load data local
infile '/path/to/data/file_2012-05-16' into table table_2012_05_16(@dummy, c1,
c2, c3, c4, c5, c6, c7);
2012-05-17 11:05:24,528 - 8988 - ERROR - Exception while executing update:
<class 'pymysql.err.InternalError'> - (1148, u'The used command is not allowed
with this MySQL version')
2) MySQL docs on the 'load data local infile...' 支持/语法。
3)如果我使用mysql客户端,这个数据加载工作正常(即恕我直言,不应该有任何障碍——权限、特权、你有什么——这个加载):
load_machine:~$ mysql -htarget_machine.baz -ufoo -pbar db -e "load data local
infile '/path/to/data/file_2012-05-16' into table table_2012_05_16(@dummy, c1,
c2, c3, c4, c5, c6, c7)"
load_machine: ~$ mysql -htarget_machine.baz -ufoo -pbar db -e "select count(*)
from table_2012_05_16;"
+----------+
| count(*) |
+----------+
| 38563191 |
+----------+