美文网首页
python 使用数据库

python 使用数据库

作者: 小疯伊始 | 来源:发表于2020-04-22 11:21 被阅读0次

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