Connection refused

Cannot connect to the MongoDB at localhost:27016.

Error:

Network is unreachable. Reason: couldn’t connect to server localhost:27016, connection attempt failed: SocketException: Error connecting to localhost:27016 (127.0.0.1:27016) :: caused by :: Connection refused

getting this error while i am trying to connect my db . Help me anyone.

Is your mongod up and running on port 27016?
How you are connecting by shell or some tool
What command was issued to connect to mongod

@Ramachandra_Tummala i am using node js in that i am using mongo DB , So After connection i tried to run my server there a error is shown , then i tried it to start with robo3t then this error is showing up

The default port is 27017. So unless you started your mongod with a different port setting you should connect to port 27017.

1 Like

If getting connection refuse at that port,I am confident mongod is not running ,first check your mongodb.conf file for the port it is set to run on.If running as a service on linux, try systemctl start mongod . Then try connect again with your mongo shell.