【发布时间】:2017-12-06 20:56:19
【问题描述】:
我正在使用 mongodb atlas 作为我的后端,我正在尝试将它连接到 intellij 的 Mongo Explorer
这是详细信息的第一张图片
这是我提供数据库用户名和密码但仍然无法连接的第二张图片。
我已经很容易地连接到 localhost 没有任何问题,但这没有连接...
我正在使用具有学生许可的 Intellij Idea Ultimate 2017.1.3。我认为这个特定的许可证和 Ide 版本没有问题
提前致谢:)
【问题讨论】:
-
检查您的服务器网址字段。与docs.mongodb.com/manual/reference/connection-string比较
-
是的,它与指定的格式匹配它看起来像这样 mongodb://practice:
@cluster0-shard-00-00-shj3q.mongodb.net:27017,cluster0-shard-00 -01-shj3q.mongodb.net:27017,cluster0-shard-00-02-shj3q.mongodb.net:27017/ ?ssl=true&replicaSet=Cluster0-shard-0&authSource=admin -
给定的url格式为mongodb://[username:password@]host1[:port1][,host2[:port2],...[,hostN[:portN]]][/ [数据库][?options]]
-
您是否尝试过服务器 url 中的
cluster0-shard-00-00-shj3q.mongodb.net:27017, cluster0-shard-00-01-shj3q.mongodb.net:27017,cluster0-shard-00-02-shj3q.mongodb.net:27017,如下所述的预期格式? -
@Andrey 是的,我已成功连接它。只需通过 cmets 即可。因为很长一段时间我都忘记了我实际上做了什么,但我肯定做了一些在 cmets 中解释过的事情。
标签: node.js mongodb intellij-idea mongodb-atlas