我无法连接到MongoDB Atlas

我无法连接到MongoDB Atlas,mongodb,Mongodb,我试图与建立联系 *mongo“mongodb+srv://cluster0.mi3o1.mongodb.net/test“--用户名cristian*在shell中。 但是,它看起来像是在尝试连接: *mongodb://127.0.0.1:27017/?compressors=disabled&gssapiServiceName=mongodb* 我发现了错误 *Error: couldn't connect to server 127.0.0.1:27017, connection att

我试图与
建立联系
*mongo“mongodb+srv://cluster0.mi3o1.mongodb.net/test“--用户名cristian*
在shell中。

但是,它看起来像是在尝试连接:
*mongodb://127.0.0.1:27017/?compressors=disabled&gssapiServiceName=mongodb*


我发现了错误

*Error: couldn't connect to server 127.0.0.1:27017, connection attempt failed: SocketException: Error connecting to 127.0.0.1:27017 :: caused by :: No connection could be made because the target machine actively refused it. :
connect@src/mongo/shell/mongo.js:374:17
@(connect):2:6
exception: connect failed
exiting with code 1      
bash: mongodb+srv://cluster0.mi3o1.mongodb.net/test: No such file or directory*
我已经创建了集群,数据库访问和管理员角色用户cristian,将我的IP和所有IP都列入了白名单
0.0.0/0
,创建了一个新的数据库,加载了示例数据库,打开了端口
27015
27016
27017
,并在portquick.net上进行了测试。

我添加了一个PRTSCN。 请帮忙


非常感谢D.SM的帮助,我的.bash_档案似乎有问题。当我对这两条路径进行复制和粘贴时,我不知道为什么终端会在另一行写入最后一个“并在这两行之间留出一些空格。我重写了这两行,但没有这样的空格:

别名mongod=“/c/Program\files/MongoDB/Server/4.4/bin/mongod.exe” 别名mongo=“/c/Program\Files/MongoDB/Server/4.4/bin/mongo.exe”


它成功了。

您没有正确填写白名单,或者您的群集已损坏。感谢您的回复,您能更具体一点吗?我已将我的ip列入白名单,等待大约10分钟,我已尝试使用0.0.0.0/0(包括您当前的ip地址)。没有成功。2个群集如何被破坏?我可以做些什么来修复?您的问题没有错误消息。没有任何可提供反馈的信息。我没有收到错误消息,我可以以某种方式记录错误吗?如果没有错误消息,您首先如何知道存在问题?