为了账号安全,请及时绑定邮箱和手机立即绑定

MYSQL导入数据报错

MYSQL导入数据报错

慕标琳琳 2018-09-05 23:09:51
开始导入MYSQL导入数据出现The MySQL server is running with the --secure-file-priv option查了一下说是Mysql的导入导出路径目录问题,改了my.ini文件中的secure-file-priv值为secure-file-priv=""现在执行SQL导入报错如下:mysql> load data infile 'E:\sql\film_test.txt' into table film_test2;ERROR 29 (HY000): File 'E:\sqlfilm_test.txt' not found (OS errno 2 - No such file or directory)文件路径是对的呢,怎么会报错找不到
查看完整描述

2 回答

?
陪伴而非守候

TA贡献1757条经验 获得超8个赞

你的MySQL是什么版本,自己编译的吗?
对这个参数有点印象,MySQL官方说明中对其有介绍,默认设置为NULL,据说会禁止数据导入导出;也有设置成DINSTALL_SECURE_FILE_PRIVDIR=/usr/local/mysql/mysql-files这样的非NULL,包括空值,不过空值会有问题:

A non-NULL value is considered insecure if it is empty, or the value is the data directory or a subdirectory of it, or a directory that is accessible by all users. If secure_file_priv is set to a nonexistent path, the server writes an error message to the error log and exits.

大体这意思是说,最好指向一个真实存在的目录,且系统用户均可访问。我记得说明手册上写的范例是在/usr/local/mysql这个目录下新建。


查看完整回答
反对 回复 2018-09-09
  • 2 回答
  • 0 关注
  • 848 浏览
慕课专栏
更多

添加回答

举报

0/150
提交
取消
意见反馈 帮助中心 APP下载
官方微信