Created
July 4, 2015 10:19
-
-
Save thpoul/1d0b605937428ff0bd0f to your computer and use it in GitHub Desktop.
Output MySQL query result to .csv format (useful for large datasets)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- This will save the the query result to /tmp/output.csv | |
SELECT | |
* | |
FROM table | |
INTO OUTFILE '/tmp/output.csv' | |
FIELDS TERMINATED BY ',' | |
ENCLOSED BY '"' | |
LINES TERMINATED BY '\n' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment