1200字范文,内容丰富有趣,写作的好帮手!
1200字范文 > mysql导出数据为txt时报错:The MySQL server is running with the --secure-file-priv option so it cannot execut

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

时间:2019-11-28 17:02:12

相关推荐

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

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/)下的f,在末尾添加“secure-file-priv=路径名”这一行,重启mysql

将要通过load data infile的文件放在上面所定义的路径下进行操作即可, --- (我这里没修改成功)

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。