I have successfully downloaded mongdb community edition by following the instruction on the website. But when I try to start up mongdb by doing this:
From Windows Explorer/File Explorer, go to C:\Program Files\MongoDB\Server\4.2\bin\ directory and double-click on mongo.exe.
The computer tries to connect with a window that looks like cmd popping up, but that window will be gone after about 1 second.
And I have attempted the other method which I put this code:"C:\Program Files\MongoDB\Server\4.2\bin\mongo.exe" into cmd and try to start it up.
But it looks like it my computer is denying the operation :
MongoDB shell version v4.2.8
connecting to: mongodb://127.0.0.1:27017/?compressors=disabled&gssapiServiceName=mongodb
2020-07-21T16:26:34.816+0800 E QUERY [js] Error: couldn't connect to server 127.0.0.1:27017, connection attempt failed: SocketException: Error connecting to 127.0.0.1:27017 :: caused by :: No connection could be made because the target machine actively refused it. :
connect#src/mongo/shell/mongo.js:341:17
#(connect):2:6
2020-07-21T16:26:34.821+0800 F - [main] exception: connect failed
2020-07-21T16:26:34.821+0800 E - [main] exiting with code 1
I would be really appreciated if someone can solve this problem for me.
Related
MongoDB shell version v4.4.6
connecting to: mongodb://127.0.0.1:27017/?compressors=disabled&gssapiServiceName=mongodb
Error: couldn't connect to server 127.0.0.1:27017, connection attempt failed: NetworkTimeout: Error connecting to 127.0.0.1:27017 :: caused by :: Socket operation timed out :
connect#src/mongo/shell/mongo.js:374:17
#(connect):2:6
exception: connect failed
exiting with code 1
Everytime when I run mongo command , it says error connecting to 127.0.0.1:27017 caused by socket opeartion timed out.
Tried following many instructions given by peers , but it didn't work.
Hope I get rid of this by your instructions.
Thanks!
Reason: mongodb service is not running
Run mongodb service method:
Open the terminal and execute mongod -dbpath "D:\Program Files\MongoDB\data\db"
("D:\Program Files\MongoDB\data\db" is the directory you created to store data)
Open another terminal and execute mongo
While o i am trying to start i am getting the below error
#(connect):1:6
exception: connect failed
C:\MongoDB\Server\4.0\bin>mongodb
'mongodb' is not recognized as an internal or external command,
operable program or batch file.
C:\MongoDB\Server\4.0\bin>mongo start
MongoDB shell version v4.0.6
connecting to: mongodb://127.0.0.1:27017/start?gssapiServiceName=mongodb
2019-03-06T15:44:04.853+0530 E QUERY [js] Error: couldn't connect to server 1
27.0.0.1:27017, connection attempt failed: SocketException: Error connecting to
127.0.0.1:27017 :: caused by :: No connection could be made because the target m
achine actively refused it. :
connect#src/mongo/shell/mongo.js:343:13
#(connect):1:6
exception: connect failed
Your using mongodb as command to start MongoDB but it should be mongod
To start MongoDB Server, run mongod.exe. Using below command,
mongod --dbpath="<DATABASE DIRECTORY>"
Then you can connect with MongoDB, Using command mongo
Default path MongoDB on Windows at C:\Program Files\MongoDB\Server\4.0\bin\mongod.exe
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 have tried all solutions mentioned in below 2 links
Mongodb: Failed to connect to 127.0.0.1:27017, reason: errno:10061
How to start mongo db on windows
But still getting below error
`C:\Program Files (x86)\MongoDB\Server\3.2\bin>mongo MongoDB shell
version: 3.2.18-15-g678cb63 connecting to: test
2018-01-26T16:39:23.926+0530 W NETWORK [thread1] Failed to connect to
127.0.0.1 :27017 after 5000ms milliseconds, giving up. 2018-01-26T16:39:23.927+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:229:14 #(connect):1:6
exception: connect failed`
Open onemore terminal as admin and run mongod. After this you can start your app in main terminal.
we have installed MongoDB 3.2.1. When i try to run it shows the following error.
C:\Program Files\MongoDB\Server\3.0\bin>mongo.exe
2016-01-13T12:48:14.974+0530 I CONTROL Hotfix KB2731284 or later update is installed, no need to zero-out data files
MongoDB shell version: 3.0.4
connecting to: test
2016-01-13T12:48:15.996+0530 W NETWORK Failed to connect to 127.0.0.1:27017, reason: errno:10061 No connection could be
made because the target machine actively refused it.
2016-01-13T12:48:16.002+0530 E QUERY Error: couldn't connect to server 127.0.0.1:27017 (127.0.0.1), connection attemp
t failed
at connect (src/mongo/shell/mongo.js:179:14)
at (connect):1:6 at src/mongo/shell/mongo.js:179
exception: connect failed
Please any one help us to solve this issue.