SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Member
    Join Date
    Nov 2012
    Posts
    3
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question ch1 issue - connecting to the database

    Hello,

    For some reason I'm stuck at trying connecting to the mongolab database.

    I've tried with amazon and joyent databases, my connection string matches the mongolab pattern:

    Code:
    function connect(){
    	var url = 'mongodb://' + username + ':' + password + address;
    	mongoose.connect(url);
    }
    Where my username/password match the DATABASE ones not the ACCOUNT.

    The error I'm receiving:

    Code:
    c:\authentication>node app
    Express server listening on port 3000
    GET /form 200 5ms
    
    events.js:72
            throw er; // Unhandled 'error' event
                  ^
    Error: failed to connect to [dbh26.mongolab.com:27267]
        at null.<anonymous> (c:\authentication\node_modules\mongoose\node_modules\mo
    ngodb\lib\mongodb\connection\server.js:569:74)
        at EventEmitter.emit (events.js:106:17)
        at null.<anonymous> (c:\authentication\node_modules\mongoose\node_modules\mo
    ngodb\lib\mongodb\connection\connection_pool.js:139:15)
        at EventEmitter.emit (events.js:98:17)
        at Socket.<anonymous> (c:\authentication\node_modules\mongoose\node_modules\
    mongodb\lib\mongodb\connection\connection.js:475:10)
        at Socket.EventEmitter.emit (events.js:95:17)
        at net.js:426:14
        at process._tickCallback (node.js:415:13)
    I've spent lots of time wrapping my head around this. Please help.

    Thanks.

  2. #2
    SitePoint Member
    Join Date
    Nov 2012
    Posts
    3
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I've found the problem.

    My dorm's internet settings were blocking the ports required to connect to mongolab.

    Switched to a different connection and it works.


Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •