MySQL problema. Can't locate file generated by select into outfile '/tmp/aa.txt'
Asked Answered
A

1

6

I ran grant file on my user. I'm using absolute path. Mysql user have privileges to write at /tmp. I just can't locate the file. I ran updatedb and then locate aa.txt, with no result.

I'm running:

select 'aaaaaa' into outfile '/tmp/aa.txt';

Mysql responds: Query OK, 1 row affected (0.02 sec)

The second time I run the same command, it get's an error:

ERROR 1086 (HY000): File '/tmp/aauua.txt' already exists

I'm running mysql 5.5.31 on Fedora 18. Does anybody knows what could be wrong?

Antimasque answered 26/5, 2013 at 4:52 Comment(5)
Are the client and server the same machine?Zielinski
The file is generated in the Server side!Blastocyst
Client and server are on the same machine.Antimasque
Instead of using into outfile, I'm now capturing the output of the mysql client (mysq params params > output.txt). But still, this issue is not solved.Antimasque
Does anybody have a clue?Antimasque
M
4

When you use SELECT ... INTO OUTFILE the file is created on the server host.

If you are aware of that, the problem might be that mysqld is started with systemd and configured to use a private /tmp directory, in that case you'll find it inside /tmp/systemd-namespace-XXXXXX/

See http://fedoraproject.org/wiki/Features/ServicesPrivateTmp

And you are not finding it with locate, since updatedb doesn't store files located in /tmp.

Murcia answered 26/7, 2013 at 8:15 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.