要支持命令load data local infile,应当在/etc/mysql/my.cnf中添加这样的设置:
[mysqld] #服务端配置
local-infle = 1
[mysql] #客户端配置
local-infile = 1
否则,mysql服务会提示错误:
ERROR 1148 (42000): The used command is not allowed with this MySQL version.
-------------------------------
另外,如果使用了python来运行的话,应该这样连接:
conn = MySQLdb.connect(host=host_str , user=user_str , passwd=pwd_str , db=db_str ,
local_infile=1, charset=charset_str)