Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
usage for node-mysql-pool
var pool = mysql.createPool({
host: '127.0.0.1',
port: '3306',
user: 'root',
password: '123456',
database: 'test',
debug: process.env.NODE_ENV == 'debug'
});
module.exports = {
query: function(sql, callback) {
pool.getConnection(function(err, connection) {
connection.query(sql, function(err, rows) {
callback(err, rows);
connection.release();
});
});
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.