MongoLab授权异常
我在 MongoLab 云服务器上创建了一个 MongoDB 帐户,并且创建了一个数据库,并且到目前为止它是空的(没有集合,只有 1 个用户)。
这就是 Mongolab 给出的连接到数据库的命令
mongo dbh13.mongolab.com:27137/myDB -u <username> -p <password>
是这里的用户名 mongolab 帐户凭据或我在 myDB 中创建的用户。我都试过了,没有授权。
但如果尝试在未经授权的情况下直接连接(来自 Windows),它会起作用 使用此命令
mongo dbh13.mongolab.com:27137/myDB
,但之后如果我尝试执行类似 show dbs/show collections 的操作,则会失败并显示以下消息
> show dbs
assert failed : listDatabases failed:{
"assertion" : "unauthorized db:admin lock type:-1 client:38.117.159.162"
,
"assertionCode" : 10057,
"errmsg" : "db assertion failure",
"ok" : 0
}
Fri Aug 12 16:30:50 uncaught exception: assert failed : listDatabases failed:{
"assertion" : "unauthorized db:admin lock type:-1 client:38.117.159.162"
,
"assertionCode" : 10057,
"errmsg" : "db assertion failure",
"ok" : 0
}
有什么想法吗?
I created a MongoDB account on MongoLab cloud server and I have a DB created and its empty (no collection, just 1 user) as of now.
this is what the command given at Mongolab to connect to the DB
mongo dbh13.mongolab.com:27137/myDB -u <username> -p <password>
is the user name here mongolab account credentials or the user i created in the myDB there.? I tried both, it's not authorizing.
but if try to connect to directly with out authorization (from Windows), it worked
with this command
mongo dbh13.mongolab.com:27137/myDB
but after which if i try to do something like show dbs/show collections it fails with the following message
> show dbs
assert failed : listDatabases failed:{
"assertion" : "unauthorized db:admin lock type:-1 client:38.117.159.162"
,
"assertionCode" : 10057,
"errmsg" : "db assertion failure",
"ok" : 0
}
Fri Aug 12 16:30:50 uncaught exception: assert failed : listDatabases failed:{
"assertion" : "unauthorized db:admin lock type:-1 client:38.117.159.162"
,
"assertionCode" : 10057,
"errmsg" : "db assertion failure",
"ok" : 0
}
Any ideas?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
获得了授权解决方案
我从 Windows shell http://support.mongolab.com/entries/20177338-im-using-the-windows-mongo-shell-and-can-t-connect-help
I got the solution for authorization from windows shell
http://support.mongolab.com/entries/20177338-i-m-using-the-windows-mongo-shell-and-can-t-connect-help