Monday 23 July 2018

MYSQL AND SED COMMAND TO EXPORT MYSQL RESULT TO A CSV FILE

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.

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/"

0 comments:

Post a Comment