[MongoDB] ServerSelectionTimeoutError: localhost:27017: [Errno 111] Connection refused
See original GitHub issueSimple test:
import json
import io
import pymongo
from pymongo import MongoClient
#client = MongoClient('mongodb://localhost:27017/')
#client = MongoClient('mongodb://localhost:27017/', connect=False)
client = MongoClient('localhost', 27017)
print(client)
dbnames = client.list_database_names()
print(dbnames)
Error:
ServerSelectionTimeoutError: localhost:27017: [Errno 111] Connection refused
Error Reproduction: https://www.kaggle.com/logachevpa/trip-routes-visualisation-on-map-by-time https://www.kaggle.com/apjansing/preliminary-taxi-data-processing-using-mongodb
Issue Analytics
- State:
- Created 3 years ago
- Comments:7 (3 by maintainers)
Top Results From Across the Web
Pymongo keeps refusing the connection at 27017
1. It should be sudo service mongodb start not sudo service mongod start · 1. path should be /var/lib/mongodb . · 2. C:\Program...
Read more >Timeout error after database directory change - MongoDB
ServerSelectionTimeoutError : localhost:27017: [Errno 111] Connection refused, Timeout: 30s, Topology Description: <TopologyDescription id: ...
Read more >could not connect to localhost:27017: [Errno 111] Connection ...
Django Version: 1.4.14. Exception Type: ConnectionFailure. Exception Value: could not connect to localhost:27017: [Errno 111] Connection refused.
Read more >Connection refused error : r/mongodb - Reddit
ServerSelectionTimeoutError : localhost:27017: [Errno 111] Connection refused, Timeout: 30s, Topology Description: <TopologyDescription id: ...
Read more >Python not connecting to mongodb in docker container
I have tried allowing by docker container IP by ufw firewall since its a connection refused issue but it doesnt work. I have...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
lol
This notebook you referenced have the same error because there is no local MongoDB server running.
Maybe they ran that code on their own computer where they have a MongoDB server.