echo 'SELECT * FROM `table`'; | mysql DB_NAME | tr -d '\r' | sed 's/"/""/g;s/\t/","/g;s/^/\"/;s/$/\"/;s/\\n/\n/g' > result.csv
Conver MySQL query result to csv Print
Modified on: Tue, 9 Oct, 2018 at 12:01 PM
Did you find it helpful?Send feedback
Sorry we couldn't be helpful. Help us improve this article with your feedback.