Reputation: 25
how include Setup Connections and Parser?
var mysql = require('mysql');
var pool = mysql.createPool({
host : 'localhost',
user : 'medb',
password : '123458',
database : 'test',
connectionLimit: 100
});
What would be next ?
Upvotes: 1
Views: 88
Reputation: 1241
Hi this is complete step to get mysql connection with pool request.
var mysql = require('mysql');
//Setup Connections and Parser
var pool = mysql.createPool({
host : 'localhost',
user : 'me',
password : '12345',
database : 'A2014',
connectionLimit: 100
});
pool.getConnection(function(err, connection) {
connection.query( 'select count(9) from mytbl;', function(err, rows) {
connection.release();
});
pool.end();
});
Upvotes: 1