标签:mysql user exp mys UI data turn require mod
var db = {}; var mysql = require(‘mysql‘); var pool = mysql.createPool({ connectionLimit: 10, host: ‘192.168.188.26‘, user: ‘aaa‘, password: ‘123456‘, port: ‘3306‘, database: ‘test‘, }); db.query = function (sql, callback) { if (!sql) { callback(); return; } pool.query(sql, function (err, rows, fields) { if (err) { console.log(err); callback(err, null); return; }; callback(null, rows, fields); }); } module.exports = db;
标签:mysql user exp mys UI data turn require mod
原文地址:http://www.cnblogs.com/alone2015/p/7943857.html