Bug #19557 Can't create/write to file ......error
Submitted: 5 May 2006 3:17 Modified: 6 May 2006 1:03
Reporter: dylan xueke Email Updates:
Status: Not a Bug Impact on me:
None 
Category:MySQL Server Severity:S5 (Performance)
Version:mysql5.0.18 OS:Linux (Fedora core 5)
Assigned to: CPU Architecture:Any

[5 May 2006 3:17] dylan xueke
Description:
I have lately updated my system to Fedora Core 5.And then i get this error message:
Can't create/write to file '/var/backup/2006_05_05_09_25fifa/admin_2006_05_05_09_25fifa.backup' (Errcode: 13)Error Number:1

My websites use 'select * from xx into outfile /var/backup/xx.backup' to backup my tables. And Surely mysql can access and write to /var/backup .It works well in older FC4 system.But now ,it seems doesn't work any more.

I have done the following test for confim:
1.mysql> select * from admin into outfile 'test.txt';
Query OK, 1 row affected (0.02 sec)

2.mysql> select * from admin into outfile '/home/dylan/backup/test.txt';
ERROR 1 (HY000): Can't create/write to file '/home/dylan/backup/test.txt' (Errcode: 13)
(Note:The priv of /home/dylan/backup is 
 drwxrwxrwx 2 mysql mysql   4096 05-05 09:20 backup
)

So what happend?
It seems that mysql5.1.2 does not support the operation of select into outfile into any files except it's datadir.

How to repeat:
why
[6 May 2006 1:03] MySQL Verification Team
Thank you for the bug report. The error displayed shows the reason for:
'/var/backup/2006_05_05_09_25fifa/admin_2006_05_05_09_25fifa.backup' (Errcode:
13)Error Number:1
^^^^^^^^
miguel@hegel:~/dbs/5.0> bin/perror 13
OS error code  13:  Permission denied
miguel@hegel:~/dbs/5.0>
[11 Jan 2007 10:15] Ivan Laptev
I've got the same error - does this bug fixed?
[15 Feb 2007 6:03] Ramamurthy Raju Sagi
Hi,

h have got the same error when used outfile.

i thought "\"is an excpsqn.i just replace "\" with "\\" .it works.

Thanks,
Raju
[27 Nov 2007 15:02] Charlie Armor
You will also receive an error message of the MySQL user ID running the query does not have "DATA FILE" privileges that allows the user ID to write to the file system.
[7 Mar 2008 2:49] fenyao wu
the same question for me. up