Pool for different schema

33 views
Skip to first unread message

Bijay Sharma

unread,
Mar 19, 2018, 10:58:30 PM3/19/18
to node-mysql
I would request to the group to please answer my below doubt. I am new to this module.

If my database server(instance running on my localhost) has three different schema (A, B and C) if all of them share same connection (i.e. connection with same credentials). Do I need to create different pool for each of them? As I saw the syntax to create a pool is database name dependent. 

// Like this
var mysql = require('mysql');
var pool  = mysql.createPool({
  host     : 'localhost',
  user     : 'root',
  password : 'root',
  database : 'A' // there can be multiple schema (which is basically a directory to group tables)
});

var mysql = require('mysql');
var pool  = mysql.createPool({
  host     : 'localhost',
  user     : 'root',
  password : 'root',
  database : 'B' // there can be multiple schema (which is basically a directory to group tables)
});

will anything change if the server is same (e.g. localhost) but all of them have different connection (connection with different credentials).
Reply all
Reply to author
Forward
0 new messages