Create an account

Very important

  • To access the important data of the forums, you must be active in each forum and especially in the leaks and database leaks section, send data and after sending the data and activity, data and important content will be opened and visible for you.
  • You will only see chat messages from people who are at or below your level.
  • More than 500,000 database leaks and millions of account leaks are waiting for you, so access and view with more activity.
  • Many important data are inactive and inaccessible for you, so open them with activity. (This will be done automatically)


Thread Rating:
  • 514 Vote(s) - 3.47 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Mongodb: Failed to connect to 127.0.0.1:27017, reason: errno:10061

#1
Here is my `mongod.cfg` file:

bind_ip = 127.0.0.1
dbpath = C:\mongodb\data\db
logpath = C:\mongodb\log\mongo-server.log
verbose=v

Here is my `mongod` service command:

mongod -f c:\mongodb\mongod.cfg --install

I have installed MongoDB about a week ago and it all worked fine, however today when I ran `mongo` command I got the following error:

Failed to connect to 127.0.0.1:27017,
reason: errno:10061 No connection could be made because the target machine actively refused it

**How can I fix that?** *I use Windows 8.1*

**Solution:**

I forgot to start mongodb service with this command:

net start mongodb

**Improved solution:**

**1)** Change directory to root drive `C:\`, and type the command below into an admin `cmd` prompt window,

C:\mongodb\bin\mongod.exe --config c:\mongodb\mongod.cfg --install

**2)** Then type `net start MongoDB` after which you should see the following message:

"The Mongo DB service was started successfully"

**3)** Then go to the control panel `Start>Administrative Tools>Services`, scroll down to MongoDB in the list of services and change start up type to automatic, if you so desire. Press OK.

**4)** Finally type `C:\mongodb\bin\mongo.exe` and you should be connected to the Mongo test DB.


Reference:
Reply

#2
The Port is not open. Thats why the machine refuses communication
Reply

#3
What solved my issue was creating a file startmongo.conf that sets the bind_ip to 127.0.0.1 . After that, I just created a *.bat to start the mongo using something like:

mongod --config c:\mongodb\bin\startmongo.conf
Reply

#4
mongodb 2.6.8 on windows7 32bits
you only need create a folder c:/data/db
execute mongod, and execute mongo
Reply

#5
If it writes that you had not properly shut down or that mongod.lock is not empty
, only delete mongod.lock from C:\data\db\ and it will start.
Reply

#6
When you typed in the mongod command, did you also give it a path? This is usually the issue. You don't have to bother with the conf file. simply type

mongod --dbpath="put your path to where you want it to save the working area for your database here!! without these silly quotations marks I may also add!"

example: mongod --dbpath=C:/Users/kyles2/Desktop/DEV/mongodb/data

That is my path and don't forget if on windows to flip the slashes forward if you copied it from the or it won't work!
Reply

#7
Point to your mongodb instalation e.g C:\Program Files\MongoDB\Serve\bin and run mongod.exe so you can open connection to 127.0.0.1:27017.
Reply

#8
Try this, it worked for me.

mongod --storageEngine=mmpav1

Reply

#9
The problem is that I missed out 'db' folder for the dbpath in the command:

C:\mongodb\bin> mongod --directoryperdb --dbpath C:\mongodb\data\db --logpath C:\mongodb\log\mongodb.log --logappend -rest --install
Reply

#10
When This Error is Coming it is lack of the following

1)Setting the path to mongo db
go to "C" Drive and the installation of Mongo db directory and then go to bin folder in the mongo and copy the path of it
> c:/mongodb/server/3.2/bin/ and create a new environmental variable in system properties then name is path and value="c:/mongodb/server/3.2/bin/" here my version is 3.2


2)create a data directory for the data in C Drive
c:/Data/twitter


3)start the server with **

>c:/> mongod

check your port config if there is any error as the local port may be assigned to any other
4)start your Mongo database with

> Mongo
then your mongo db will start

then in your mongo database
**create a database**

> use DATABASE_NAME

for example:

use twitterdata

switched to db twitterdata

to check your current database

> db

twitterdata

to get total databases

> show dbs





Reply



Forum Jump:


Users browsing this thread:
2 Guest(s)

©0Day  2016 - 2023 | All Rights Reserved.  Made with    for the community. Connected through