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

another problem with this class that I can't run it on windows, this class is so confuse .

I have run the command mongod and this work something, after I create a directory mkdir \data\db this create a folder inside the disc C: but when I come back run the command mongod it doesn't work for me and always an error like no permission to connect the server , may someone help me please, it's so difficult for me, I can understand how mongodb works but I don't know how to use on windows machine .

2 Answers

Jennifer Nordell
seal-mask
STAFF
.a{fill-rule:evenodd;}techdegree
Jennifer Nordell
Treehouse Teacher

Hi there! Because you're running Windows, you're going to have to run the mongod command relative to the path in which you installed it. This means that in your CLI you need to navigate to the folder where you installed MongoDB and then issue the command.

This is both documented in the installation guide linked in the Teacher's Notes and is stated in the video between 2:49 and 2:53:

If you installed Mongo manually, you'll need to navigate to the unzipped folder and run the command relative to the folder itself.

Because I don't know where you installed it, it's impossible for me to say which path you need to navigate to, but this should be the way to do it. Also note, that you will likely need to be logged onto an account on your Windows machine that has local administrator access.

Hope this helps! :sparkles:

right , I have made all thing that you mecionate, but now just one thing that you talk here is so diferrent, how can I loggin on my machine as a admin ? I didt'n understand this part can you explan me ? ou some link for help me ? cause all process that you mecionate I have done it, my unique problem is with the new folder when I create the \data\db it doest'n work me I don't know why , and don't get connect with the server always failed and I Don't know how to fix that .

Jennifer Nordell
seal-mask
.a{fill-rule:evenodd;}techdegree
Jennifer Nordell
Treehouse Teacher

Rafael silva If you click on Start -> Control Panel -> User Accounts and Family Safety you should see a link for "Add and Remove user accounts". You're not going to use this to adjust anything right now, but you need to look at your account and see if it is marked as "Administrator". Let me know if you have an Administrator account :smiley:

Jennifer Nordell, I have already create an account as admin but the error continue, this is the problem when I run the mongo at my cmd and I don't know how fix it, please help me please .

2018-01-08T20:22:57.619-0200 I CONTROL [main] Hotfix KB2731284 or later update is not installed, will zero-out data files MongoDB shell version: 3.2.18-6-g6166b55 connecting to: test 2018-01-08T20:23:02.908-0200 W NETWORK [thread1] Failed to connect to 127.0.0.1 :27017 after 5000ms milliseconds, giving up. 2018-01-08T20:23:02.910-0200 E QUERY [thread1] Error: couldn't connect to ser ver 127.0.0.1:27017, connection attempt failed : connect@src/mongo/shell/mongo.js:229:14 @(connect):1:6

exception: connect failed

Jennifer Nordell
seal-mask
.a{fill-rule:evenodd;}techdegree
Jennifer Nordell
Treehouse Teacher

It sounds like the mongod is not currently running and listening on that port. To confirm that mongod is listening on port 27017, enter the command netstat -a in the Windows command line. If you cannot find a service listening on 27017, it means that the mongod hasn't been successfully launched and running.

Also, you said that you made an admin account, but you didn't say if you made an admin account in MongoDB or on Windows. I'm asking about administrator access to the operating system, not the database.

The note you have about the KB2731284 is indicating that your operating system is not updated. Please update your operating system as soon as possible :smiley:

first thank you so much to be patient with me, and this is all step that I have following.

1 - I already create an account as admin on my operating system 2 - I type the command netstat -a and this port like you metionate is not run 3 - about KB2731284 I already update the operating system 4 - and I don't how create an admin account on MongoDb

question: Now how can I solve that problem ?

Jennifer Nordell
seal-mask
.a{fill-rule:evenodd;}techdegree
Jennifer Nordell
Treehouse Teacher

Hi again! Well, the KB2731284 warning is specifically about a Windows update that is not installed. What is the error you get when you run mongod?

wow ! awesome , now it solve my problem , thank you so much teacher you're so great, I'm so happy with you, I don't know how to thank you ,Now I can continue class, kiss for you teacher :) ..

Jennifer Nordell
seal-mask
.a{fill-rule:evenodd;}techdegree
Jennifer Nordell
Treehouse Teacher

Rafael silva that's great! I'm glad you/we got it working. That being said, I'd like to make it clear that I'm neither Treehouse staff nor a teacher. I'm a student just like yourself :smiley:

really ? cool ! hey can I Keep contact with you in some social media ? maybe we can be friend if you want .

Here this is the error like doest'n connect to this port 27017 and don't run .

C:\Program Files\MongoDB\Server\3.2\bin>mongod 2018-01-08T22:48:48.427-0200 I CONTROL [main] 2018-01-08T22:48:48.435-0200 W CONTROL [main] 32-bit servers don't have journ ing enabled by default. Please use --journal if you want durability. 2018-01-08T22:48:48.435-0200 I CONTROL [main] 2018-01-08T22:48:48.470-0200 I CONTROL [main] Hotfix KB2731284 or later updat is not installed, will zero-out data files 2018-01-08T22:48:48.500-0200 I CONTROL [initandlisten] MongoDB starting : pid 492 port=27017 dbpath=C:\data\db\ 32-bit host=Gamebook 2018-01-08T22:48:48.502-0200 I CONTROL [initandlisten] targetMinOS: Windows V ta/Windows Server 2008 2018-01-08T22:48:48.503-0200 I CONTROL [initandlisten] db version v3.2.18-6-g 66b55 2018-01-08T22:48:48.506-0200 I CONTROL [initandlisten] git version: 6166b5586 dc6c5ac2cc2aa4c78b60f4c234c2d 2018-01-08T22:48:48.507-0200 I CONTROL [initandlisten] allocator: tcmalloc 2018-01-08T22:48:48.511-0200 I CONTROL [initandlisten] modules: none 2018-01-08T22:48:48.517-0200 I CONTROL [initandlisten] build environment: 2018-01-08T22:48:48.519-0200 I CONTROL [initandlisten] distarch: i386 2018-01-08T22:48:48.520-0200 I CONTROL [initandlisten] target_arch: i386 2018-01-08T22:48:48.523-0200 I CONTROL [initandlisten] options: {} 2018-01-08T22:48:48.535-0200 I STORAGE [initandlisten] exception in initAndLi en: 28663 Cannot start server. The default storage engine 'wiredTiger' is not ailable with this build of mongod. Please specify a different storage engine e licitly, e.g. --storageEngine=mmapv1., terminating 2018-01-08T22:48:48.537-0200 I CONTROL [initandlisten] dbexit: rc: 100

Jennifer Nordell
seal-mask
.a{fill-rule:evenodd;}techdegree
Jennifer Nordell
Treehouse Teacher

Ok then! Well there we have the problem! Yay we found the problem! The mongod cannot be started because it's using the wrong storage type. So when you go to access your database, you can't because mongo failed to start completely.

I found this thread on stackoverflow which has an accepted answer on how to fix this. Essentially, you should be following the directions listed in the error message itself.

Mongo is actually trying to tell you how to fix it here in the error:

Please specify a different storage engine explicitly, e.g. --storageEngine=mmapv1

Hope this helps! :sparkles: