Export MySQL table as csv file

Exporting from an RDBMS always depends on the syntax of the specific RDBMS in question.  For MySQL, here is how to transform a SELECT statement into a CSV export:

SELECT a,b INTO OUTFILE '/tmp/result.csv'  FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"'  LINES TERMINATED BY 'n'  FROM test_table;

Reference: MySQL 5.0 Reference Manual

This entry was posted in Data Warehouse, Dedicated Servers, Hosting Support, Managed Hosting and tagged , . Bookmark the permalink.

NewPush has solutions to fit your business needs.  For more than a decade, our focus has been to take on the technical challenges that are the hardest and most time-consumming.  Our goal is to free up your resources to focus on the core activities of your business and to drive your business performance.  Please visit our main site at newpush.com for more information or call us at +1-303-423-4500.