writing to a data outfile mysql

46 Views Asked by At

This is a bit confusing to me. I am trying to export records out of my database into a csv file using mysql on AWS.

I do the select:

select BusinessName into outfile '/tmp/test.csv' from contractors limit 2;

and I get a message back

Query OK, 2 rows affected (0.00 sec)

I then go to /tmp to see the file and I don't see it. What I do find is:

/tmp/systemd-private-bc19608036e44476bfd3ef62c52ed14a-mariadb.service-jvEm06/tmp/test.csv

What I would really like is to be able to have the file go to my home directory but I am not sure where or where mysql is putting all the garbage at the beginning of the file. I am figuring this is a setting some where.

Any ideas?

1

There are 1 best solutions below

0
On

Ok I got it. Thank you @Akina I looked closer in the logs it seems it was an odd permissions issue on the directory I was using. fixed now.