Read more

Export CSV from MySQL directly

Thomas Eisenbarth
December 15, 2010Software engineer at makandra GmbH

If you need to export data from MySQL to a CSV, you can profit from really fast built-in methods.

Illustration UI/UX Design

UI/UX Design by makandra brand

We make sure that your target audience has the best possible experience with your digital product. You get:

  • Design tailored to your audience
  • Proven processes customized to your needs
  • An expert team of experienced designers
Read more Show archive.org snapshot

This query writes the data to /tmp/geodb_coodinates.csv. And it's fast: Query OK, 337925 rows affected (0.86 sec)

SELECT * INTO OUTFILE '/tmp/geodb_coordinates.csv' FIELDS TERMINATED BY ',' ENCLOSED BY '"' ESCAPED BY '\\' LINES TERMINATED BY '\n' FROM geodb_coordinates;
Posted by Thomas Eisenbarth to makandra dev (2010-12-15 19:19)