title: ERROR 1064 (42000) MySQL when inside a shell script
body: <p>I have shell script with mysql command, there I am getting ERROR 1064 (42000).
  MySQL Version (5.5.32)</p>
  
  <pre><code>#!/bin/ksh
  #ALCO update
  #Author:Umani
  
  a=`date`
  
  echo $a
  
  mysql -u root &lt;&lt; EOF
  use test;
  select offer_id,action_date from alco_offer_assign_history where offer_id='307' limit 10;
  bye;
  
  
  echo "Complete"
  
  exit;
  </code></pre>
  
  <p>Sample Output:</p>
  
  <pre><code>307 2/20/2014 14:40
  307 2/20/2014 14:42
  307 2/20/2014 14:42
  307 2/20/2014 14:42
  </code></pre>
  
  <p>ERROR 1064 (42000) at line 3: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'bye' at line 1</p>