Skip to content

Instantly share code, notes, and snippets.

@joeyAghion
Created November 17, 2010 00:43
Show Gist options
  • Save joeyAghion/702807 to your computer and use it in GitHub Desktop.
Save joeyAghion/702807 to your computer and use it in GitHub Desktop.
select database rows into csv
SELECT id, first_name, last_name, location, created_at, updated_at
INTO OUTFILE '/tmp/petition_signatures.csv' FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"' ESCAPED BY '\\' LINES TERMINATED BY '\n'
FROM petition_signatures;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment