美文网首页
pymysql fetchall 查询结果返回字典

pymysql fetchall 查询结果返回字典

作者: HAO延WEI | 来源:发表于2019-06-01 17:10 被阅读0次
import pymysql
from pymysql.cursors import DictCursor

connect  = pymysql.connect(
   host='127.0.0.1',
   port=3306,
   db='dbname',
   user='root',
   passwd='',
   charset='utf8'
)
cursor = connect.cursor(DictCursor)

相关文章

网友评论

      本文标题:pymysql fetchall 查询结果返回字典

      本文链接:https://www.haomeiwen.com/subject/knuatctx.html