title: Select mysql query with bash
body: <p>How to <code>select</code> mysql query with bash so each column will be in a separate array value?</p>
  
  <p>I've tried the following command but it only works if the content is one word. for example:
  id= 11, text=hello, important=1</p>
  
  <p>if I've an article for instance in <code>text</code>. the code will not work properly. I guess I can use <code>cut -f -d</code> but if "text" contains special characters it wont work either.</p>
  
  <pre><code>while read -ra line; do
      id=$(echo "${line[1]}")
      text=$(echo "${line[2]}")
      important=$(echo "${line[3]}")
  
      echo "id: $id"
      echo "text: $text"
      echo "important: $important"
  
  done &lt; &lt;(mysql -e "${selectQ}" -u${user} -p${password} ${database} -h ${host})
  </code></pre>