How can I use two database connections in node.js? (mysql) -


i want make requests 2 databases using express , mysql modules , listen on port 8000.

you create multiple db connections using mysql node package like:

var mysql      = require('mysql');  var connection = mysql.createconnection({...}); var otherconnection = mysql.createconnection({...}); 

see node-mysql documentation

createconnection creates new, separate database connection object on each call.


Comments

Popular posts from this blog

ios - Assigning a value out of array of arrays, using section in Xcode -

javascript - Website analyzer -