How do i do this:
mysql -u myuser -p mydb -e \"select f1,f2 from mytable\" > /tmp/mydata.txt
But I want to separate the fields with a c
I don't really understand what is the question? Can you explain what you want ?
If your wish is to add delimiter to your output, you have to use CONCAT_WS :
mysql -u myuser -p mydb -e "select CONCAT_WS(',',f1,f2) from mytable" > /tmp/mydata.txt