028-86922220

建站动态

根据您的个性需求进行定制 先人一步 抢占小程序红利时代

python链接mysql数据库

import MySQLdb
conn=MySQLdb.connect(host='127.0.0.1',user='root',passwd='123456',db='08day5')
cur=conn.cursor()
#打开数据库
#提取数据
reCount=cur.execute('select * from admin')
data =cur.fetchall()
print reCount
print data
#关闭数据
cur.close()
conn.close()

文章标题:python链接mysql数据库
文章位置:http://www.tsicrk.com/article/johicd.html

其他资讯

让你的专属顾问为你服务

1.0216s