This question already has answers here:
Creating a database in Mongo: can't connect, get "connect failed"
(5 answers)
Closed 6 years ago.
I am trying to start my mongo but i have come across the following error
W NETWORK [thread1] Failed to connect to 127.0.0.1:27017, reason: errno:111 Connection refused
E QUERY [thread1] Error: couldn't connect to server 127.0 .0.1:27017, connection attempt failed :
connect#src/mongo/shell/mongo.js:229:14
I am trying to start my mongo but i have come across the following error
I had no idea about the error can any one please help me out of here...........
You shoud start the mongod server first.
use this...
mongod --port 27017
then start
Related
when I'm trying to open mongodb with command prompt I'm getting a error message like
D:\mongo-bd\bin>mongo.exe
MongoDB shell version v3.6.4
connecting to: mongodb://127.0.0.1:27017
2018-04-27T18:50:28.340+0530 W NETWORK [thread1] Failed to connect to 127.0.0.1
:27017 after 5000ms milliseconds, giving up.
2018-04-27T18:50:28.340+0530 E QUERY [thread1] Error: couldn't connect to ser
ver 127.0.0.1:27017, connection attempt failed :
connect#src/mongo/shell/mongo.js:251:13
#(connect):1:6
exception: connect failed
I have tried by running mongo --repair command but still I'm facing this problem.
1 First set up the data directory - google it
2 then run the
{installationDirectory}/MongoDB/Server/{serverVersion}/bin/mongod.exe
to start the service
3 Get into the shell
{installationDirectory}/MongoDB/Server/{serverVersion}/bin/mongo.exe
I am using mongodb on ubuntu-16.04 but mongodb give server connection error:
MongoDB shell version: 3.2.9 connecting to: test
2016-09-23T12:01:10.258+0530 W NETWORK [thread1] Failed to connect to 127.0.0.1:27017, reason: errno:111 Connection refused
2016-09-23T12:01:10.286+0530 E QUERY [thread1] Error: couldn't connect to server 127.0.0.1:27017, connection attempt failed : connect#src/mongo/shell/mongo.js:229:14 #(connect):1:6 exception: connect failed
What can I do?
looks like your mongod process is not running on port 27017. Make sure your mongod process is running maybe verify with linux command.
If you start mongod process and even then it's failing to connect with mongo command, it means it's failing to intialize, check out designated mongo log file for the reason
I am writing mongo in shell. but it is not starting. The error message is:
W NETWORK [thread1] Failed to connect to 127.0.0.1:27017, reason: errno:111 Connection refused
What to do?
Run mongod Before mongo. May be You forgot to do that.
This question already has answers here:
Mongodb: Failed to connect to 127.0.0.1:27017, reason: errno:10061
(17 answers)
Closed 6 years ago.
i'm newbie in mongodb and after installing mongo installer package on windows i get this error when i try to use mongo on shell and command prompt. i can not find any solution for this problem:
C:\Program Files\MongoDB 2.6 Standard\bin>mongo
MongoDB shell version: 2.6.7
connecting to: test
2015-02-20T16:43:11.971+0330 warning: Failed to connect to 127.0.0.1:27017, reas
on: errno:10061 No connection could be made because the target machine actively refused it.
2015-02-20T16:43:11.987+0330 Error: couldn't connect to server 127.0.0.1:27017 (
127.0.0.1), connection attempt failed at src/mongo/shell/mongo.js:146
exception: connect failed
C:\Program Files\MongoDB 2.6 Standard\bin>
You have to make sure that mongod is up and running.
Another probable cause would be that the port is not open.
I've come across the following thread on SO with multiple possible solutions to your problem --- LINK
I m trying connect to my db in Mongolab:
>> mongo ds123456.mongolab.com
MongoDB shell version: 2.6.1
connecting to: ds123456.mongolab.com/test
2014-12-16T14:13:41.738+0100 warning: Failed to connect to 54.74.247.101:27017, reason: errno:10061 No connection could be made because the target machine actively refused it.
2014-12-16T14:13:41.741+0100 Error: couldn't connect to server ds123456.mongolab.com:27017 (54.74.247.101), connection attempt failed at src/mongo/shell/mongo.js:148
exception: connect failed
I assume this question answers the first problem of access being blocked on this port.
The obvious solution is to contact the network admin. But I wonder if there is an alternative?
Thanks in advance.