当尝试使用user和pwd登录时,Mongo会因“登录失败”而窒息

时间:2016-10-27 00:34:53

标签: mongodb authentication login authorization database

用户'tyuser'已添加到admin数据库中的system.users集合中:

{user: 'tyuser',
 pwd: 'typwd',
 roles: [{role: 'readWrite', db: 'testy'}]}

mongod然后以mongod --auth

开始

尝试mongo testy -u tyuser -p typwd

mongo barfs with“exception:login failed”

以经过身份验证的用户访问“testy”数据库的正确方法是什么?

0 个答案:

没有答案
相关问题