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数据库
分享URL:http://www.scyingshan.cn/article/johicd.html

 建站
建站
 咨询
咨询 售后
售后
 建站咨询
建站咨询 
 