Can't find the file created by outfile in MySQL

Viewed 62623

I am using the following query to create a CSV file

SELECT email INTO OUTFILE "mydata.csv"
FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"'
LINES TERMINATED BY "\n"
FROM users;

But i am unable to find the mydata.csv file anywhere when i am searching through filezilla.

Any idea where this file is getting stored?

The query runs successfully without any errors! Any Help?

8 Answers

+1 to @michael-berkowski and the answer i needed for windows was (as he stated)

MariaDB's data directory

to be specific, mine was in the data folder for database named "mydatabase"

C:\Program Files\MariaDB 10.3\data\mydatabase

If you don't specify an absoulte path but use something like INTO OUTFILE 'output.csv' or INTO OUTFILE './output.csv', it will store the output file to the directory specified by show variables like 'datadir';.

Related