Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem with 'pool' #2

Open
scottlet opened this issue Dec 31, 2013 · 1 comment
Open

Problem with 'pool' #2

scottlet opened this issue Dec 31, 2013 · 1 comment

Comments

@scottlet
Copy link

var config = {
    db: {
        host: 'localhost',
        user: process.env.DB_USER || 'root',
        password: process.env.DB_PWORD ||  '',
        port: process.env.DB_PORT || 3306,
        database: process.env.DB_NAME || 'xxx',
        multipleStatements: true
    }
}
app.use(myConnection(mysql, config.db, 'pool'));

Gives me the following error:

ReferenceError: pool is not defined
    at IncomingMessage.req.getConnection (/Users/scottvanlooy/Development/Node/fcnode/node_modules/express-myconnection/lib/express-myconnection.js:86:21)
    at getContent (/Users/scottvanlooy/Development/Node/fcnode/routes/index.js:36:7)
    at exports.index (/Users/scottvanlooy/Development/Node/fcnode/routes/index.js:55:2)
    at callbacks (/Users/scottvanlooy/Development/Node/fcnode/node_modules/express/lib/router/index.js:164:37)
    at param (/Users/scottvanlooy/Development/Node/fcnode/node_modules/express/lib/router/index.js:138:11)
    at pass (/Users/scottvanlooy/Development/Node/fcnode/node_modules/express/lib/router/index.js:145:5)
    at Router._dispatch (/Users/scottvanlooy/Development/Node/fcnode/node_modules/express/lib/router/index.js:173:5)
    at Object.router (/Users/scottvanlooy/Development/Node/fcnode/node_modules/express/lib/router/index.js:33:10)
    at next (/Users/scottvanlooy/Development/Node/fcnode/node_modules/express/node_modules/connect/lib/proto.js:193:15)
    at Object.loc [as handle] (/Users/scottvanlooy/Development/Node/fcnode/node_modules/loc/lib/i18n.js:129:3)

Not sure why, any ideas?

pwalczyszyn added a commit that referenced this issue Mar 27, 2014
@kalyankj
Copy link

For pool, your dbOptions must perhaps look like:
{host:'xxx', user: 'xxx',password:'xxx',database : 'xxx',connectionLimit: 100,waitForConnections: true}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants