title: mysql via subprocess doesn't work
body: <pre><code>import os
  import subprocess
  cmdline = ['mysql -u"username" -p"password" &lt; query.sql']
  p = subprocess.Popen(cmdline,stdout=subprocess.PIPE)
  stdout,stderr = p.communicate()
  retcode = p.wait()
  </code></pre>
  
  <p>That's my code to connect to mysql and execute query.sql. Looks good to me, but it doesn't work and the bad thing is that I don't get any error message at all. retcode is 1 and from stdout, stderr I only get the mysql standard text "Usage mysql [OPTIONS] [Database] ..." so I thought my syntax is wrong. But it's not. I tested the line of code in terminal and it works.</p>
  
  <p>Does python have a problem to execute this via subprocess? I just want an easy way to execute this small mysql code.
  Thanks.</p>