您的位置:首页 > 博客中心 > 数据库 >

python mysql模块

时间:2022-03-14 15:07

#!/usr/bin/python

import MySQLdb


def new_mail_mysql(ak):

    print ak

    conn=MySQLdb.connect(host=‘m3306.sae.sina.com.cn‘,user=‘sae_ol‘,passwd=‘7b149edb22ae7526‘,db=‘sae‘,port=3306)

    cur=conn.cursor()

    sql="select name from app where accesskey=‘%s‘"%ak

    cur.execute(sql)

    app_name=cur.fetchall()

    return app_name

    cur.close()

    conn.close()


if __name__ == ‘__main__‘:

    ak=new_mail_mysql(‘4yywo5lm02‘)

    print ak


本文出自 “” 博客,请务必保留此出处

python mysql模块,布布扣,bubuko.com

热门排行

今日推荐

热门手游