title: Execute multiple statement on MySQLdb cursor
body: <p>I want to execute multiple statements on a <code>MySQLdb</code> cursor over a database with <strong>MyISAM</strong> storage. I followed every other way explained in this <a href="https://stackoverflow.com/questions/5669878/python-mysqldb-when-to-close-cursors">answer</a> and elsewhere, unsuccessfully.</p>
  
  <pre><code>&gt;&gt;&gt; import MySQLdb as mdb
  &gt;&gt;&gt; from contextlib import closing
  
  &gt;&gt;&gt; con = mdb.connect('host', 'user', 'password', 'database')
  
  &gt;&gt;&gt; with closing(con.cursor()) as cur:
  &gt;&gt;&gt;     cur.callproc('add_date', [1418112000])
  &gt;&gt;&gt;     cur.callproc('add_date', [1418119000])
  &gt;&gt;&gt;     #con.commit()
  &gt;&gt;&gt;     cur.close()
  
  _mysql_exceptions.ProgrammingError: (2014, "Commands out of sync; you can't run this command now")
  </code></pre>
  
  <p>Since the storage of tables is <strong>MyISAM</strong>, I should not need to call commit(). In fact if I call <code>commit()</code>, I will encounter an error.</p>
  
  <p>What is the correct way to call multiple statements?</p>