Skip to content

Instantly share code, notes, and snippets.

@peterberkenbosch
Created March 26, 2009 10:48
Show Gist options
  • Save peterberkenbosch/86007 to your computer and use it in GitHub Desktop.
Save peterberkenbosch/86007 to your computer and use it in GitHub Desktop.
Howto export a query result from mysql into a csv file
SELECT order_id,product_name,qty
FROM orders
INTO OUTFILE '/tmp/orders.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