Wednesday, August 2, 2006

How to export MYSQL to CSV

Simply execute

SELECT <fields or *> INTO OUTFILE '/tmp/result.text'
FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"'
LINES TERMINATED BY '\n'
FROM <table> WHERE <condition>

No comments:

Post a Comment