def do_work(q):
    con = pool.get_connection()
print('PID %d: using connection %s' % (os.getpid(), con))
c = con.cursor()
c.execute(q)
res = c.fetchall()
con.close()
return res

def main():
    pass
Accessing a MySQL connection pool from Python multiprocessing