1var pool = mysql.createPool({
2 connectionLimit : 10,
3 host : 'example.org',
4 user : 'bobby',
5 password : 'pass'
6 });
7
8pool.getConnection(function(err, connection){
9 if(err){
10 return cb(err);
11 }
12 connection.changeUser({database : "firm1"});
13 connection.query("SELECT * from history", function(err, data){
14 connection.release();
15 cb(err, data);
16 });
17});
18