mysql_curd.py 文件源码

python
阅读 34 收藏 0 点赞 0 评论 0

项目:python 作者: hienha 项目源码 文件源码
def getConn(conninfo):
    host = conninfo['host']
    user = conninfo['user']
    password = conninfo['password']
    port = conninfo['port']
    sock = conninfo['sock']
    db = conninfo['db']
    # print host, user, password, port, db
    try:
        conn = MySQLdb.Connect(host=host, user=user, passwd=password, port=port, unix_socket=sock, db=db, charset='utf8')
    except Exception as e:
        print e
        sys.exit()

    return conn
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号