最赞回答 / Charles_Xiao
在python3.x中已经不支持mysqldb。取而代之的是:import pymysql另外,mysql官方出了个mysql.connector,也可以用。例子如下:import pymysqlconn = pymysql.connect(host='127.0.0.1', port=3306, user='root', passwd='test',db='mysql')cur = conn.cursor()cur.execute("SELECT * FROM user")for r in cur.fe...
2016-05-13