-4

I want to export results of a sql query to a CSV file (comma delimited ) using unix scripting. Please help

0

1 Answer 1

2

Try this (soource: Export Data From Database to CSV File)

mysql -u user -p pass database -B -e "select * from
\'person\';" | sed 's/\t/","/g;s/^/"/;s/$/"/;s/\n//g' > filename.csv

Not the answer you're looking for? Browse other questions tagged or ask your own question.