title: MySQL access denied from bash when executing MySQL commands
body: <p>When I log in to mysql from a bash script such as this:</p>
  
  <pre><code>mysql --user="$USERNAME" --password="$PASSWORD" --database="$DATABASE" &lt;&lt; EOF
  # No command here
  EOF;
  </code></pre>
  
  <p>My user is logged into the database and it works fine. But when my bash script does something as simple as</p>
  
  <pre><code>mysql --user="$USERNAME" --password="$PASSWORD" --database="$DATABASE" &lt;&lt; EOF
  show tables;
  show columns from some_table;
  ...
  # Now there are commands
  EOF;
  </code></pre>
  
  <p>Mysql gives me this error: Access denied for user 'user'@'localhost' to database 'database'
  What would cause this? </p>
  
  <p>To clarify, I'm perfectly able to just call <code>mysql -uUser -pPass database</code> from the command line, log in, then call <code>show tables;</code>.  It's only when run from a bash script, and when that bash script includes a mysql command does my access get denied.</p>
  
  <p>Furthermore is there a simple-to-use library for python/c++ that handles mysql interaction and doesn't involve having to sign up for something in order to obtain the library?</p>