不用连接池的MySQL连接方法importMySQLdbconn=MySQLdb.connect(host='localhost',user='root',passwd='pwd',db='myDB',port=3306)cur=conn.cursor()SQL="select*fromtable1"r=cur.execute(SQL)r=cur.fetchall()cur.close()conn.close()用连接池后的连接方法importMySQLdbfromDBUtils.PooledDBimportPooledDBpool=PooledDB(MySQLdb,5,host='localhost',user='root',passwd='pwd',db='myDB',port=3306)#5为连接池里的最少连接数