title: python mysql: connection cursor has no execute attribute
body: <p>while trying out some mysql voodoo, the follwing error pops up. i read
  other questions here and the suggestions were to use a cursor for the connection which i already have done imho. so what could be wrong here?</p>
  
  <pre><code>#!/usr/bin/env python
  
      import os
      import sys
      import MySQLdb as db
      try:
          import json
          from json import JSONDecodeError
      except ImportError:
          import simplejson as json
          from simplejson import JSONDecodeError
  
      connections = {
          'conn1': db.connect('nimmsag_a', 'aix_regread', 'cmdbuser', 'aix_registry'),
          'conn2': db.connect('localhost', 'ansible', 'ansible', 'ansible_inv')
      }
  
      connections['conn1'].cursor.execute('SELECT * FROM TABLES;')
      connections['conn2'].cursor.execute('SELECT * FROM TABLES;')
  
      [conn.close() for key, conn in connections.items()]
  
  root@lpgaixmgmtlx01:/root&gt;./reg2inv.py
  Traceback (most recent call last):
    File "./reg2inv.py", line 18, in &lt;module&gt;
      connections['conn1'].cursor.execute('SELECT * FROM TABLES;')
  AttributeError: 'function' object has no attribute 'execute'
  </code></pre>