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';

```

Useful details:

* web application : DVWA (localhost) (for study purposes)
* Server: Apache/2.2.14 (Ubuntu) - PHP/5.3.2
* MySQL version 5.1.63
* Operating system Linux Backtrack 5r3.

I'm running the command as root. Also, I can freely create folders or files in /var/www/

Errcode 13 I know it means permission denied, but what should I do in order to fix the problem?

Any help will be highly appreciated.