Exporting query details to csv file
Posted by proofek on October 10, 2008
2 comments
Founded somewhere in the net. Really useful.
From the Unix commandline (Bourne Shell compatible):
output tab-seperated:
echo “select * from example;” | mysql -u user -h host -ppass
Want another delimeter? Add
| tr ‘^V^I’ ‘;’
to the pipe and you will get csv or any other delimeter you want.
Skipping the first row (Table Header): add
| tail -n +2 [...]
