title: Sql script when run vi mysql python gives error
body: <p>I wrote a python script to execute my sql script. When i manually run this sql script using source it doesn't give me any error just warning and it fully executes as :</p>
  
  <pre><code>mysql&gt; source the_actual_script.sql
  Database changed
  Query OK, 0 rows affected, 1 warning (0.00 sec)
  
  Query OK, 0 rows affected, 1 warning (0.00 sec)
  
  Query OK, 0 rows affected, 1 warning (0.00 sec)
  
  Query OK, 0 rows affected, 1 warning (0.00 sec)
  
  Query OK, 0 rows affected, 1 warning (0.00 sec)
  
  Query OK, 0 rows affected (0.00 sec)
  
  Query OK, 0 rows affected (0.29 sec)
  
  Query OK, 0 rows affected (0.00 sec)
  
  mysql&gt; 
  </code></pre>
  
  <p>But when i try and run it via my python code :</p>
  
  <pre><code>import MySQLdb
  
  db = MySQLdb.connect("aws.eu-central-1.rds.amazonaws.com","prod_user","pass","db_name")
  cursor = db.cursor()
  for line in open("/home/ubuntu/PATCHER/the_check_query.sql"):
    print  cursor.execute(line)
  db.close()
  </code></pre>
  
  <p>It gives me errors :</p>
  
  <pre><code>test.py:8: Warning: PROCEDURE saas_neopostsa.temp_prod does not exist
    cursor.execute(line)
  test.py:8: Warning: PROCEDURE saas_neopostsa.temp_prod_neopost does not exist
    cursor.execute(line)
  test.py:8: Warning: PROCEDURE saas_neopostsa.temp_prod_neopostsa does not exist
    cursor.execute(line)
  test.py:8: Warning: Unknown table 'temp_identity_neopostsa'
    cursor.execute(line)
  test.py:8: Warning: Unknown table 'temp_identity'
    cursor.execute(line)
  Traceback (most recent call last):
    File "test.py", line 8, in &lt;module&gt;
      cursor.execute(line)
    File "/usr/lib/python2.7/dist-packages/MySQLdb/cursors.py", line 174, in execute
      self.errorhandler(self, exc, value)
    File "/usr/lib/python2.7/dist-packages/MySQLdb/connections.py", line 36, in defaulterrorhandler
      raise errorclass, errorvalue
  _mysql_exceptions.OperationalError: (1065, 'Query was empty')
  </code></pre>
  
  <p>can someone help me what's wrong ?</p>