0

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?

  • MySQL itself stores the outfile woth strictly specified pathname (or fails due to some reason). So this is AWS issue. Check real SQL text received by MySQL in General log. Study AWS documentation about this issue. – Akina Oct 01 '20 at 04:52
  • Kindly check on MySQL server on same path /tmp/test.csv – ROHIT KHURANA Oct 01 '20 at 10:14
  • @ROHITKHURANA I have and I cannot find a sitting. I can load from a directory of my choosing but not export. – JAYCO Cloud Oct 02 '20 at 00:51

1 Answers1

0

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.