title: two database connections with mysql in nodejs
body: <p>I want to connect to two databases as one database is used for login and other db is used to fetch data for logged in user.</p>
  
  <p>I have created two DB connections as following, but it is overwriting the previous connection</p>
  
  <pre><code>var express = require('express');
  var path = require('path');
  var AWS = require('aws-sdk');
  var connection  = require('express-myconnection'); 
  
  //second connection
  var myConnection = require('express-myconnection');
  
  var mysql = require('mysql');
  var app = express();
  var session = require('express-session');
  var cookieParser = require('cookie-parser');
  var bodyParser = require('body-parser');
  var passport = require('passport');
  var localStrategy = require('passport-local').Strategy;
  
  app.use(
  connection(mysql,{
      host: 'localhost',
      user: 'user1',
      password : 'pass1',
      port : 3306, //port mysql
      database:'database1'
  },'pool') //or single
  );
  
  app.use(
  myConnection(mysql,{
      host: 'localhost',
      user: 'user2',
      password : 'pass2',
      port : 3306, //port mysql
      database:'database2'
  },'pool') //or single
  );
  </code></pre>