我得到这个错误时,连接到MongoDB阿特拉斯使用猫鼬。首先,我尝试使用Mongo客户端,我得到了同样的错误。然后我换了一只猫鼬,它工作得很好,但突然就停止工作了。我已经在网络访问中添加了“允许从任何地方”和我的IP。
MongooseServerSelectionError: Could not connect to any servers in your MongoDB Atlas cluster. One common reason is that you're trying to access the database from an IP that isn't whitelisted. Make sure your current IP address is on your Atlas cluster's IP whitelist: https://docs.atlas.mongodb.com/security-whitelist/发布于 2021-12-10 07:15:30
您需要在Atlas中添加您的系统IP,在那里您已经在Atlas中创建了您的数据库。要白名单多个IP地址,请转到MongoDB地图集上的目标集群。接下来,转到“安全”选项卡下的“网络访问”。在“IP白名单”选项卡上,单击“添加IP地址”。在“白名单”项下手动键入IP地址,然后单击“确认”。
发布于 2021-12-10 08:43:23
确保当前IP地址在Atlas集群的IP白名单上,如错误message.Follow中给出的,这是https://studio3t.com/knowledge-base/articles/mongodb-atlas-login-ip-whitelisting/文章中给出的步骤
https://stackoverflow.com/questions/70300111
复制相似问题