MySQL Forums
Forum List  »  General

Re: Export data to CSV
Posted by: Peter Brawley
Date: February 20, 2015 08:37AM

Given a MySQL query in a string variable, you can easily assemble an INTO OUTFILE version of it for export.

Select Into Outfile can use Load Data Infile syntax to create a file in csv format. It writes the result set to a file on the server host, and requires a file privilege there. There's a tutorial on this at http://www.mysqltutorial.org/mysql-export-table-to-csv/.

Percona has an enhanced version of the cmd.

Once the file is written, your app can offer it as a download to the user, and optionally delete it after the download.

Sorry, can't answer your question about cluster.

Options: ReplyQuote


Subject
Written By
Posted
February 20, 2015 06:33AM
Re: Export data to CSV
February 20, 2015 08:37AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.