I'm trying to export a table in MySQL as a CSV, but I'm having trouble. I've tried two approaches, neither of which have worked.
First:
SELECT *
INTO OUTFILE '/path/to/filename.csv'
FIELDS TERMINATED BY ','
ENCLOSED BY '"'
ESCAPED BY '\\'
LINES TERMINATED BY '\n'
FROM table;
Second:
mysqldump -u [username] -p -t -T/path/to/directory [database] [table] --fields-enclosed-by=\" --fields-terminated-by=,