标签:
MySQLdb使用程序
#!/bin/env python import MySQLdb conn = MySQLdb.connect(host = "", user="", passwd="", port=8307, db="") cursor = conn.cursor() try: cursor.execute(sql) data = cursor.fetchall() conn.commit() except MySQLdb.Error, e: print e cursor.close() for row in data: print row
标签:
原文地址:http://www.cnblogs.com/cfox/p/4498448.html