JavaScript execution failed connected to mongoHQ shell

后端 未结 2 876
-上瘾入骨i
-上瘾入骨i 2021-01-17 10:54

Trying to access MongoHQ directly:

> mongo mongodb://heroku:mypassword@alex.mongohq.com:10046/myapp
MongoDB shell version: 2.4.3
connecting to: mongodb://         


        
相关标签:
2条回答
  • 2021-01-17 11:08

    Just see if you have $ in your password, in that scenario enclose your password with ' ' then try to connect.

    e.g.

    mongo mongodb://host:port/authdb -username dbusername -p 'password$123'

    0 讨论(0)
  • 2021-01-17 11:18

    This is a shell bug and it's not a new one. Basically the mongo shell doesn't accept the same format of connection string that regular mongodb drivers do. I can reproduce this error in the current and previous versions and this syntax isn't expected to work (though it probably shouldn't crash either, but there is already a bug for the shell to accept standard connection string: jira.mongodb.org/browse/SERVER-3254

    Meanwhile you can connect by using the mongo shell options such as

    mongo -u <user> -p <passwd> hostIP:port/db 
    

    or

    mongo --host host --port port [ other options ] db
    
    0 讨论(0)
提交回复
热议问题