msyql数据导入问题--secure-file-priv

写了一个指令想要导入数据

load data infile '{某路径}/map.txt' into table ncbi_uniprot_map fields terminated by '\t' lines terminated by '\n' (pro,uniprot);

map.txt是n行两列的无标题表格,两个filed分别是pro和uniprot,{某路径}是自定义路径。
结果一这样写,mysql就开始报错:

ERROR 1290 (HY000): The MySQL server is running with the --secure-file-priv option so it cannot execute this statement

这个option不能执行那条语句,变量secure-file-priv是安全导入导出文件夹路径,如果为空则为NULL,如果有路径,则我们应该把导入导出文件放到该路径下。用 show variables like ‘secure_file_priv‘指令查找secure_file_priv的变量值,找到存放路径为:/var/lib/mysql-files
因此将{某路径}改为/var/lib/mysql-files就可以了。

参考文献:
http://www.mamicode.com/info-detail-1686775.html

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容