#!/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