Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
usage for node-mysql-pool
var pool = mysql.createPool({
host: '',
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);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment