On Friday, 5 February 2016 11:33:24 UTC+11, udara Ratnayake wrote:
hi, I just try to start mongodb after installation 3.2.1.
- my configuration file as follows (mongo.config)
…- when I try to start on windows8, was hang like not come to prompt. log saying “waiting for connections on port 27017”
- open a new command prompt I try to connect to mongo DB to use it.
error output says data dictionary path is different. as mondo looking default location of c:/data/db.
- again I changed the path in mondo.config and try to start. but still hang with “waiting for connection” error.
Hi,
To work with MongoDB you need to have a server running (on Windows: mongod.exe) and connect using a driver (iC#, PHP, …) or an admin interface (for example mongo.exe, which is the standard administrative shell.
The configuration file you mentioned in your step 1 is for the MongoDB server (mongod.exe) and only read if you pass it as a command line option. For example, you could start a MongoDB server using this config file with: mongod.exe --config mongo.config
The “waiting for connections” message in your step 2 is the expected message if you run mongod.exe. This means the MongoDB server is running and waiting for client connections. If you want to connect to this server you need to: leave mongod.exe running, open a separate command prompt window, and run mongo.exe in the new command prompt window.
So, in your step 3 can you try connecting using mongod.exe? Assuming your MongoDB server is running on the same machine, you should see a startup message similar to:
MongoDB shell version: 3.1.2
connecting to: test
>
If this is the first time you have used the mongo shell, there will also be an additional welcome message. You can type help for a list of commands and will probably find the tutorial on Getting Started with MongoDB useful to learn how to work with documents in the mongo shell.
If you are going to be using MongoDB frequently on your machine, you will probably find it more convenient to configure a Windows service to start and stop the MongoDB server rather than running mongod.exe from a command prompt. The Windows service can also be configured to start MongoDB automatically at boot time.
Regards,
Stephen