python2和python3 分别连接MySQL的代码
python2中的写法如下: 1 #coding=utf-8 2 import MySQLdb 3 4 try: 5 conn = MySQLdb.connect(host='localhost', port=3306, db='python3', user='root', passwd='mysql', charset='utf8') 6 curso...