我正在使用ipython 2.7。我在mongodb中創建數據庫名稱enron。我試圖在本地連接到這個數據庫,但發生了以下錯誤 - 我該如何解決它?如何使用python在本地連接到Mongo數據庫
這是我的代碼:
import json
import pymongo # pip install pymongo
from bson import json_util
from pymongo import MongoClient# Comes with pymongo
conn = pymongo.Connection('mongodb://user:[email protected]:33499/enron')
client = MongoClient()
錯誤:
ConnectionFailure: could not connect to localhost:27017: [Errno 10061] No connection could be made because the target machine actively refused it