title: weakly-referenced object no longer exists using python and mysql
body: <p>I have a local database which i try to  update using python the following code is what i used</p>
  
  <pre><code>&gt;&gt;&gt; from mysql.connector import connect
  &gt;&gt;&gt; p = connect(user="root", password="", host="127.0.0.1", port="3306", database='ef')
  &gt;&gt;&gt; cur = p.cursor()
  &gt;&gt;&gt; p = "s"
  &gt;&gt;&gt; cur.execute("""update ef_reg set region_status = %s where region_id=851""",(p))
  </code></pre>
  
  <p>When i run the last one i get following error.</p>
  
  <pre><code>Traceback (most recent call last):
    File "&lt;stdin&gt;", line 1, in &lt;module&gt;
    File "/Library/Python/2.7/site-packages/mysql/connector/cursor.py", line 473, in execute
      if not self._connection:
  ReferenceError: weakly-referenced object no longer exists
  </code></pre>