dresende / node-orm2

Object Relational Mapping
http://github.com/dresende/node-orm2
MIT License
3.07k stars 379 forks source link

why password is incorrect but database connection is not being given? #664

Closed hacke2 closed 8 years ago

hacke2 commented 8 years ago

I connect db :

var orm = require("orm"),
    db = null,
    opts = {
        database: "inspiration",
        protocol: "mysql",
        host: "127.0.0.1",
        port: 3306,
        username: "root",
        password: "root1111",
        query: {
            debug : false,
            pool: true
        }
    };

console.info('connecting');
try {
    db = orm.connect(opts);
    console.info('connect success');
}catch(err) {
    console.error('connect error', err);
}

module.exports = db;

the password is incorrect but app console success, only if db server stop it console error, why?

hacke2 commented 8 years ago

the console should in callback