Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Databases Mongo Basics Getting Started With MongoDB Setting Up MongoDB

Jonathan Grieve
MOD
Jonathan Grieve
Treehouse Moderator 91,252 Points

Unable to Setup Mongo

It's a shame but I'm unable to set up Mongo on my Windows machine.

I'm following the instructions on the Teachers notes. I use Windows 7 so it downloads Mongo to my program files directory. Windows command prompt won't add \fata\db to the directory. And I can't use homebrew as it's a Mac application.

Now I like to think of my self as reasonably confident on the command line. I can get by. But when I try to open mongod.exe inside the bin folder I get a response but it's not the same as in the video.

That could be because it's a slightly different version but I suspect not. I get the "waiting for connections on port 27017, as the final line in the command prompt but what comes before it is different.

It looks like I'm not connecting to Mongo because "the target computer is actively refusing" connections.

What's the Mongo Shell? How do I get to it?

Basically I don't have a clue what I'm doing.... help!! :o

4 Answers

jason chan
jason chan
31,009 Points

https://youtu.be/1uFY60CESlM?list=PL6gx4Cwl9DGDQ5DrbIl20Zu9hx1IjeVhO

If your on windows.

Make sure to have mongod on terminal
mongo the other terminal
Jonathan Grieve
Jonathan Grieve
Treehouse Moderator 91,252 Points

Hi Jason, that's a great link thanks for providing it. I've picked up some very useful tips from it. I forgot how good Bucky's tutorials are. I found Treehouse through ads on his videos and I abandon him for Treehouse. :D

Anyway I digress.

I think what's happening is I'm missing a file or 2 that's stopping me from connecting to Mongo.

Command line image

What could have I have missed?

William Curry
William Curry
4,107 Points

Excellent link. Extremely grateful for not only the solution, but another edu source aimed at Windows users.

Jonathan Grieve
Jonathan Grieve
Treehouse Moderator 91,252 Points

nothing seems to be work.

I should be able to access Mongo by using Windows Command Prompt right? by typing CMD into start menu.

if I try to use the mongo command first it isn't picked up even though I know the files for mongo are installed.

jason chan
jason chan
31,009 Points

Have you checked the ports? Something might be blocking mongod port? Maybe your antivirus that was me before.

you try following a long on c9.

https://docs.c9.io/docs/setting-up-mongodb

My tutorial on how to setup mongodb on cloud9

https://youtu.be/DAKaEXSJs9Q

Jonathan Grieve
Jonathan Grieve
Treehouse Moderator 91,252 Points

I'm not an expert but I think I'm good to go now?

Command line image

I opened mongo first and then mongod and it says one connecton opened but I'm not sure what it says about Hotfix KB2731284

jason chan
jason chan
31,009 Points

that means your good man.

try the following commands:

show dbs
use db
show collections
db.collectionname.find().limit(1)

That's about it.

Jonathan Grieve
Jonathan Grieve
Treehouse Moderator 91,252 Points

Excellent, seem to be sorted from here thanks for your help :)