开发者

pymongo error when connecting to test:27017

开发者 https://www.devze.com 2023-03-01 02:45 出处:网络
This is my code: con = pymongo.Connection(\'test\',27017) and the error is: (mysite)zjm1126@zjm1126-G41MT-S2:~/桌面/test/mongo$ python a.py

This is my code:

con = pymongo.Connection('test',27017)

and the error is:

(mysite)zjm1126@zjm1126-G41MT-S2:~/桌面/test/mongo$ python a.py
Traceback (most recent call last):
  File "a.py", line 3, in <module>
    con = pymongo.Connection('test',27017,slave_okay=True)
  File "build/bdist.linux-i686/egg/pymongo/connection.py", line 352, in __init__
  File "build/bdist.linux-i686/egg/pymongo/connection.py", line 576, in __find_mas开发者_StackOverflowter

What can I do?

EDIT:

Change 'test' to 'localhost'


Obviously there is no mongod daemon running on test:27017.

0

精彩评论

暂无评论...
验证码 换一张
取 消