1. mongoDB VUE问题
但是不能打开数据库,出现异常:
[mongo@localhost data]$ wc -l socialRelation.json
73224 socialRelation.json
Invalid credentials for database 'admin'.
Type: MongoDB.Driver.MongoAuthenticationException
Stack: 在 MongoDB.Driver.Internal.MongoConnection.Authenticate(String databaseName, MongoCredentials credentials)
在 MongoDB.Driver.Internal.MongoConnection.CheckAuthentication(MongoDatabase database)
在 MongoDB.Driver.MongoServerInstance.AcquireConnection(MongoDatabase database)
在 MongoDB.Driver.MongoServer.AcquireConnection(MongoDatabase database, Boolean slaveOk)
在 MongoDB.Driver.MongoCursorEnumerator`1.AcquireConnection()
在 MongoDB.Driver.MongoCursorEnumerator`1.GetFirst()
在 MongoDB.Driver.MongoCursorEnumerator`1.MoveNext()
在 MongoDB.Driver.MongoDatabase.GetCollectionNames()
在 MangoUI.MCollections.GetAll(String db)
在 MangoUI.MCollections.Get(String db)
在 MangoUI.ComNavTree.nuedayAQwLobI9qiNSO(Object , Object )
在 MangoUI.ComNavTree.ExpandMe(MTreeNode expand)
在 MangoUI.ComNavTree.tree_BeforeExpand(Object sender, TreeViewCancelEventArgs e)
Command 'authenticate' failed: auth failed (response: { "ok" : 0.0, "errmsg" : "auth failed", "code" : 18 })
Type: MongoDB.Driver.MongoCommandException
Stack: 在 MongoDB.Driver.Internal.MongoConnection.RunCommand(String collectionName, QueryFlags queryFlags, CommandDocument command)
在 MongoDB.Driver.Internal.MongoConnection.Authenticate(String databaseName, MongoCredentials credentials)
Inputs::
Command: authenticate
Ok: False
ErrorMsg: auth failed
Request: { "authenticate" : 1, "user" : "root", "nonce" : "648317e89c43ccfc", "key" : "41883f43c1a02de50cd0611a6bca0603" }
Response: { "ok" : 0.0, "errmsg" : "auth failed", "code" : 18 }
解答:
权限认证问题。mongo默认的启动方式是没有权限认证的,就是不需要用户名密码,但是如果你启动mongo服务的时候加上了-auth,则必须使用正确的用户名和密码才能登陆。
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/29050044/viewspace-2127452/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/29050044/viewspace-2127452/