Here is the quick and dirty on how to query directly to a csv in MySQL.
SELECT id, name, email INTO OUTFILE '/tmp/result.csv'
FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"'
ESCAPED BY ‘\\’
LINES TERMINATED BY '\n'
FROM users WHERE 1In MS Windows OUTFILE would be:OUTFILE 'C:/tmp/results.csv'Make sure mysql can write to the location of your outfile
Labels:
csv,
export,
mysql,
things I am sick of Googling
Subscribe to:
Post Comments (Atom)
0 comments:
Post a Comment