title: How to dump result of a sql query into a file
body: <p>Ok so I am in a situation where I need to dump the results of a sql query into a file and this is for backup purpose I tried running th following from my terminal : </p>
  
  <pre><code>mysql -e "select * from products where brand_id=5" -u root -p database_name &gt; dumpfile.sql
  </code></pre>
  
  <p>this dumps the data but with the "insert into statements", so if later on I want to dump this data back into my database I will be re-composing it. And that is not the correct approach. So please suggest me how do I dump query results for back up purpose ?</p>