要支持命令load data local infile,应当在/etc/mysql/my.cnf中添加这样的设置:
否则,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)
本文介绍如何通过修改MySQL配置文件my.cnf以启用loaddatalocalinfile命令,并给出使用Python进行连接的示例。
5122

被折叠的 条评论
为什么被折叠?



