could not connect to localhost:27017: [Errno 61] Connection refused

2,275 views
Skip to first unread message

Gigi Wu

unread,
Nov 9, 2013, 1:54:23 PM11/9/13
to mongod...@googlegroups.com
Hi everybody,

I am interested to build my own site by python and mongodb so I was following this tutorial...

Write a Tumblelog Application with Flask and MongoEngine

and then got stuck pretty soon. ;(

When I proceeded to execute : 
$python manage.py shell 

I got error message as following:
Traceback (most recent call last):
  File "manage.py", line 6, in <module>
    from testCJL import app
  File "/**my_path**/__init__.py", line 8, in <module>
    db = MongoEngine(app)
  File "/**my_path**/[name_of_virtualenv]/lib/python2.7/site-packages/flask_mongoengine/__init__.py", line 32, in __init__
    self.init_app(app)
  File "/**my_path**/[name_of_virtualenv]/lib/python2.7/site-packages/flask_mongoengine/__init__.py", line 53, in init_app
    self.connection = mongoengine.connect(**conn_settings)
  File "/**my_path**/[name_of_virtualenv]//lib/python2.7/site-packages/mongoengine/connection.py", line 162, in connect
    return get_connection(alias)
  File "/**my_path**/[name_of_virtualenv]/lib/python2.7/site-packages/mongoengine/connection.py", line 125, in get_connection
    raise ConnectionError("Cannot connect to database %s :\n%s" % (alias, e))
mongoengine.connection.ConnectionError: Cannot connect to database default :
could not connect to localhost:27017: [Errno 61] Connection refused

Does anybody get idea about what's wrong?
Thanks in advance!

Bernie Hackett

unread,
Nov 9, 2013, 3:23:23 PM11/9/13
to mongod...@googlegroups.com
Did you start the server (mongod) and is it running on port 27017 (the default)?


--
--
You received this message because you are subscribed to the Google
Groups "mongodb-user" group.
To post to this group, send email to mongod...@googlegroups.com
To unsubscribe from this group, send email to
mongodb-user...@googlegroups.com
See also the IRC channel -- freenode.net#mongodb
 
---
You received this message because you are subscribed to the Google Groups "mongodb-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mongodb-user...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Neville Dipale

unread,
Nov 10, 2013, 12:48:11 AM11/10/13
to mongod...@googlegroups.com
Hi, I had a similar problem on Mongo 2.4.8 in production, it happened just after I upgraded from 2.4.7.

Restarting Mongo helped

İ. Behiç Şakar

unread,
Apr 15, 2015, 6:07:33 AM4/15/15
to mongod...@googlegroups.com
Anyone solved this problem ? It is not related with "mongod" started or not. 

Thanks


On Saturday, 9 November 2013 20:54:23 UTC+2, Gigi Wu wrote:

Bernie Hackett

unread,
Apr 16, 2015, 2:45:09 PM4/16/15
to mongod...@googlegroups.com
This thread is 2 years old. Please start a new discussion and provide us with the exact details of the problem you are having, including any tracebacks.

Also, please make sure that you are using PyMongo <= 2.8 with MongoEngine as it does not yet support PyMongo 3.0. 
Reply all
Reply to author
Forward
This conversation is locked
You cannot reply and perform actions on locked conversations.
0 new messages