conn.begin()
после conn.cursor() try:
cursor.execute( "SELECT VERSION()" )
results = cursor.fetchone()
# Check if anything at all is returned
if results:
xconn = True
else:
xconn = False
except MySQLdb.Error as e:
print ("ERR::CheckConnect : ERROR %d IN CONNECTION: %s" % (e.args[0], e.args[1]) )
xconn = False
...