Posted By

Leech on 10/03/08


Tagged

mysql dump csv export execute


Versions (?)

Who likes this?

4 people have marked this snippet as a favorite

yosemite610
nublaii
jeremydouglass
beleneglorion


Execute MySQL query from console and export to CSV


 / Published in: Bash
 

URL: http://www.cpanelconfig.com/tips/mysql-execute-query-from-console-and-export-to-csv/

  1. mysql –database=database –execute=”select a from b where a>1;” | sed ’s/\t/”,”/g;s/^//;s/$//;s/\n//g’ > filename.csv

Report this snippet  

You need to login to post a comment.