选择*到输出文件中,即使对于root用户也不起作用 [英] select * into outfile not working even for root

查看:137
本文介绍了选择*到输出文件中,即使对于root用户也不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我跑步时

mysql> select * into outfile "/home/akihirom/file1.txt" from BAIT_INTERACTION;

我收到以下错误:

错误1(HY000):无法创建/写入文件'/home/akihirom/file1.txt'(错误代码:13)

ERROR 1 (HY000): Can't create/write to file '/home/akihirom/file1.txt' (Errcode: 13)

甚至在root上,在mysql或系统本身中也会发生这种情况.有谁知道为什么会这样?谢谢

This happens even as root, in mysql or on the system itself. Does anyone know why this may be happening? Thanks

推荐答案

我能够通过将select语句的内容转储到文件中来使用mysql dump做同样的事情:

I was able to do the same thing using mysql dump by dumping the contents of the select statement to a file:

mysql -u USERNAME --password=PASSWORD --database=DATABASE --execute='SELECT `FIELD`, `FIELD` FROM `TABLE` LIMIT 0, 10000 ' -X > file.xml

我从哪里得到这个想法

这篇关于选择*到输出文件中,即使对于root用户也不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆