简体   繁体   English

使用C#的Mongodb远程服务器

[英]Mongodb Remote Server with C#

I wanted to know a connection format to connect to a local server using an IP. 我想知道一种使用IP连接到本地服务器的连接格式。 I used the following but no luck 我用了以下但没有运气

mongodb//x.x.x.x:27017

And also do I need to have configuration in my server to allow connection from remote machines? 我还需要在服务器中进行配置以允许从远程计算机进行连接吗? Thanks. 谢谢。 I really aprecciate your help. 我真的很感谢您的帮助。

You are missing the colon. 您想念冒号。 It's mongodb://xxxx:27017 . 这是mongodb://xxxx:27017 27017 is the default port so you can omit that if you wish. 27017是默认端口,因此您可以根据需要忽略该端口。 And, of course you need to open port 27017 on the other side. 并且,当然,您需要在另一侧打开端口27017。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM