You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

MongoDB Atlas应用连接失败求助:已白名单IP仍报错

MongoDB Atlas 连接问题求助

我正在开发一款学习类应用,需要连接MongoDB Atlas。目前通过Compass可以正常连接,但应用端无法连接,报错信息如下:

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.

我已做过以下排查操作:

  • 检查网络访问列表,仅添加了我的IP且地址正确,但系统自动添加了/32后缀,无法删除,仅能修改为/24或/16等网段格式
  • 尝试设置“允许所有IP访问”,仍出现相同报错

创建数据库时提供的连接字符串如下,我直接使用该字符串,也尝试过将集群名替换为应用名,结果一致:
mongodb+srv://myUserName:myUserPassword@traversyclaster.xxxxx.mongodb.net/?retryWrites=true&w=majority&appName=TraversyClaster

恳请协助解决此问题,Codeium未能提供有效帮助。

内容的提问来源于stack exchange,提问作者vitaliy4us

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.06.17 00:28:09