1
votes

I downloaded 64-bit zipped version of mongodb for windows, created '/data/db' as instructed. Now, when I run "mongod" command, I am getting the following error & the mongodb server shuts down automatically.

"ERROR : listen() failed error-10013. An attempt was made to access socket in a way forbidden by its access permissions. "

Please help me to clear the firewall settings in windows to prevent this error & run mongodb.

5
I was able to fix the error by using the following command : "mongod --bind_ip="127.0.0.1". :)Dharshni
Perhaps better to put your comment in an answer and accept it. It can be useful to other users.kranteg

5 Answers

1
votes

This error also seems to happen when mongod is already running. On Windows 10, mongod will be listed under Background Processes in the Task Manager if it is running. If it is already running, ending the task should allow you to run mongod again without this error occurring. Also check that it is not running as a service; it may be set to restart automatically.

0
votes

I was able to fix the error by using the following command : "mongod --bind_ip="127.0.0.1". :)

0
votes

Also, if you have a docker container running mongodb, you also get this error. If you stop your container(s) running mongodb, then it should start up.

0
votes

I was able to fix this issue by allowing access for Mongo Db Server Application under firewall settings in my antivirus settings.

After you did the above step,open the cmd as administrator and go to the bin path of mongodb application in your system.

Then run the below command. mongod

Note : try the above steps only after you tried the below steps

1) https://docs.mongodb.com/manual/tutorial/configure-windows-netsh-firewall/

2)https://www.tomshardware.com/news/how-to-open-firewall-ports-in-windows-10,36451.html

0
votes

I ran across a similar error which is why I ended up on this thread. For me, my solution was that McAfee Antivirus was blocking MongoDB.

The initial error basically showed that access was denied for mongo: mongo error

I was able to do a search on the internet and found steps to allow MongoDB to run under McAfee Antivirus software by changing the setting for the app directly. mcaffee settings

When I located MongoDB in the apps requesting internet access, it was initially set to blocked. I selected the app, clicked on edit and changed it to 'Designated ports'.
mongodb settings changed

Now, I am able to run mongo whether the mongod service is started automatically or if I start it manually in a hyper terminal window.