您的位置:首页 > 数据库 > SQL

mysql>导出数据为txt时报错:The MySQL server is running with the --secure-file-priv option so it cannot execut

2017-05-15 11:20 1181 查看
mysql> select * from anserchapp.searchApp into outfile '/home/data/searchApp/en/searchApp_cn.txt';
ERROR 1290 (HY000): The MySQL server is running with the --secure-file-priv option so it cannot execute this statement

原因:

目录无权限

解决:

法1,

直接使用默认的权限文件夹(/var/lib/mysql-files/)作为导出目录即可,

mysql> select * from anserchapp.searchApp into outfile '/var/lib/mysql-files/sapp';

Query OK, 137784 rows affected (45.88 sec)

法2,

修改MySQL安装路径(/etc/mysql/)下的my.cnf,在末尾添加“secure-file-priv=路径名”这一行,重启mysql

将要通过load data infile的文件放在上面所定义的路径下进行操作即可, --- (我这里没修改成功)
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐