错误代码13,选择输入到输出文件 [英] Errcode 13 , SELECT INTO OUTFILE issue
问题描述
我试图了解使用INTO OUTFILE命令时遇到问题的原因.
I'm trying to understand the reason why I keep experiencing problems while using INTO OUTFILE command.
我总是会收到此错误消息:
I always get this erroro:
ERROR 1 (HY000): Can't create/write to file '/var/www/p1.txt' (Errcode: 13)
SELECT password FROM mysql.user WHERE user='root' INTO OUTFILE '/var/www/p1.txt';
有用的细节:
-
Web应用程序:DVWA(本地主机)(出于学习目的)
web application : DVWA (localhost) (for study purposes)
服务器:Apache/2.2.14(Ubuntu)-PHP/5.3.2
Server: Apache/2.2.14 (Ubuntu) - PHP/5.3.2
MySQL版本5.1.63
MySQL version 5.1.63
操作系统Linux Backtrack 5r3.
Operating system Linux Backtrack 5r3.
我以root用户身份运行命令.另外,我可以在/var/www/
I'm running the command as root. Also, I can freely create folders or files in /var/www/
错误代码13我知道这意味着权限被拒绝,但是我应该怎么做才能解决此问题?
Errcode 13 I know it means permission denied, but what should I do in order to fix the problem?
任何帮助将不胜感激.
推荐答案
将/var/www锁定为试图写入文件的用户,或将chmod 777/var/www
chown /var/www to the user trying to write the file, or chmod 777 /var/www
这可能不是一种安全的方法,您可能需要考虑将文件放在其他位置
this is probably not a secure way of doing it, you might like to consider putting the file elsewhere
这篇关于错误代码13,选择输入到输出文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!