Mysql and sed command to export mySQL result to a CSV file

When you are manipulating data in and out of mySQL the quicker way with big databases resoults is the command line.

 camino

When you are manipulating data in and out of mySQL the quicker way with big databases resoults is the command line.

This is a very handy command line to export a mySQL query result to a csv file using mysql and sed altogether.

mysql -B -u root -p123 iln -h localhost -e "SELECT * FROM postid_and_articleid;" |sed "s/'/'/;s/t/"
About the author
Eduardo Silva was born in Buenos Aires, Argentina, and has being living in London for the past 15 years. With a background in psychology he is a IT developer and the co-founder of open-ecommerce.org, a digital content social enterprise. His passion is digital story-telling and has created short films and documentaries to help people promote there ideas.