3

From this documentation: https://mariadb.com/kb/en/library/select-into-outfile/

I ran

MariaDB []> select ... into outfile 'leads_ny.csv';
Query OK, 6674 rows affected (0.47 sec)

Now I can't find the file. I looked in the current working directory, the directory I started mysql in, my home directory, I even ran find on each of those, but I can't find it. I'm currently running $ find / -name leads_ny.csv.

mysql Ver 15.1 Distrib 10.1.30-MariaDB

Chloe
  • 25,162
  • 40
  • 190
  • 357

2 Answers2

6

Found it! Was in the DB data directory

/var/lib/mysql/dbname/leads_ny.csv
Chloe
  • 25,162
  • 40
  • 190
  • 357
  • 1
    You can specify a full path in the `OUTFILE` part but be aware that this may be restricted by your server settings. Also be aware that large CSV output files may exhaust your database partition's free space and cause issues, so always check that you've got enough free space before proceeding for large tables. – tadman Jul 26 '18 at 18:56
0

On Mac OS Sierra the folder was /usr/local/var/mysql

iGuest
  • 71
  • 5