var mysql=require("mysql");

var pool = mysql.createPool({
    host: '127.0.0.1',
    user: 'lee',
    password: 'yunyou!9527pk3',
    database: 'pay_b22',
    port: 3888,
    charset:'utf8mb4'
});

exports.query = function(sql,callback){
    pool.getConnection(function(err,conn){
        if(err){
            callback(err,null,null);
        }else{
            conn.query(sql,function(qerr,vals,fields){
                //释放连接
                conn.release();
                //事件驱动回调
                callback(qerr,vals,fields);
            });
        }
    });
};

