1
4

4 回答 4

4

MongoLab creates databases that require an authenticated user to access. When you connect with the Shell, you will need to provide the UserName and Password to the shell command. Docs are here.

mongo --username Mark --password something

You will need that Username/Password combination to be configured within mongoose as well. The Mongoose docs have details on the possible ways to do this.

Note that you are using a very old shell. 1.8.3 is about 4 versions back from the current 2.4.* line. This is not directly related to your problem, but it's definitely something you should rectify going forward.

于 2013-07-12T17:31:16.517 回答
3

Inside the mongo shell try to authenticate once again:

db.auth('yourUsername','yourPassword');

于 2013-07-27T23:22:09.247 回答
0

One possible error could be like me : Using special chars in the password breaks the URI!

The generated password was

X/apm~nq5JaJ,5

So OBVIOUSLY, the / broke the request and I got :

MongoError: not authorized for query on apm~nq5JaJ.system.indexes
于 2015-05-30T09:54:57.743 回答
0

You can try to include at the end of your URI: ?authMode=scram-sha1

于 2016-08-12T20:53:34.090 回答