MongoDB中对集群的身份验证失败

时间:2019-07-28 08:18:12

标签: mongodb mongo-shell atlas

我正在尝试从Mongo Shell连接到我的沙盒。

1。)我已经安装了MongoDB shell 2.)在MongoDB Atlas中,我创建了一个沙箱和一个具有管理员权限的用户 3.)我以可以从任何地方连接的方式配置了IP白名单

我在MongoDB中进入clusters部分,然后单击connect。接下来,我选择了“使用Mongo shell连接”选项,并在命令行中复制了以下代码:

mongo "mongodb+srv://mongodbbasics-diahg.mongodb.net/test" --username m001-student 

接下来,我输入密码,然后遇到以下错误

 [js] Error: can't authenticate against replica set node mongodbbasics-shard-00-01-diahg.mongodb.net:27017 :: caused by :: can't connect to new replica set master [mongodbbasics-shard-00-01-diahg.mongodb.net:27017], err: Location8000: bad auth Authentication failed. :
connect@src/mongo/shell/mongo.js:344:17
@(connect):2:6
exception: connect failed

0 个答案:

没有答案
相关问题