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
Post a Comment