比如我本机装了MongoDB并且开启了服务,没有任何其他设置,这个时候另一台机子直接连我机子用ip如192.168.1.33:27017即可。
但是现在我通过xshell连接到一台服务器,假设ip是192.168.1.4,登陆用户名root,密码123456,MongoDB也启动了服务,端口也是27017,但是别的机子通过连接192.168.1.4:27017连接不成功,需要如何设置服务器呢?这个时候如何带上用户密码。连接错误提示是目标计算机积极拒绝。
使用MongoVUE连接也不行,提示输入用户名密码,我填的是xshell连接服务器的用户名密码,MongoDB应该没设用户和密码。
Took a look at the MongoDB service monitoring address, so if you use 192.168.1.4, the connection will not be connected and will be rejected. This is a single response
Add the following lines to the mongod file. If it already exists, please modify it
In addition, if it is redhat, centos series, open the firewall port
Temporarily turn off selinux
The answer above is correct. There is a bind ip in the configuration file. For remote access, it needs to be changed to the external IP or the external IP of the internal network. Then open the corresponding port. As for client connection, if it is the latest version 3.0 or above, please refer to /q/1010000002776398