I am trying to connect to my mongo database in my remote server:
$ mongo xxx.xxx.xxx.xx:27017
But I get this error:
MongoDB shell version: 2.6.10 connecting to: xxx.xxx.xxx.xx:27017/test 2016-11-07T05:18:39.140+0000 warning: Failed to connect to xxx.xxx.xxx.xx:27017, reason: errno:111 Connection refused 2016-11-07T05:18:39.142+0000 Error: couldn't connect to server xxx.xxx.xxx.xx:27017 (xxx.xxx.xxx.xx), connection attempt failed at src/mongo/shell/mongo.js:148 exception: connect failed
Any ideas why?
I even have tried to connect it with an username and password but it still fails to connect...
environment
? I'm on linux ubuntu. – laukokcat /etc/mongod.conf
there must be a line withbind_ip 127.0.0.1,xx.xx.xx.xx
where xx.xx.xx.xx is your public IP – Molda