python2
yuminstall-y MySQL-python
onn=MySQLdb.connect(host="127.0.0.1",port=22066,user="root",passwd="123456",db="dsideal_db",charset="utf8")
cursor=conn.cursor()
sql = "select * from test"
n = cursor.execute(sql)
for row in cursor.fetchall():
python2
yuminstall-y MySQL-python
onn=MySQLdb.connect(host="127.0.0.1",port=22066,user="root",passwd="123456",db="dsideal_db",charset="utf8")
cursor=conn.cursor()
sql = "select * from test"
n = cursor.execute(sql)
for row in cursor.fetchall():
本文标题:python 使用数据库
本文链接:https://www.haomeiwen.com/subject/krnbihtx.html
网友评论