Database Reference
In-Depth Information
Installing MongoDB under Windows
Microsoft's Windows is also a popular choice for server software, including Internet-based
services.
Windows doesn't come with a repository application like apt-get, so you'll need
to download and extract the software from the MongoDB website to run it. Yes, the
preceding information is correct. You do not need to walk through any setup process;
installing the software is a simple matter of downloading the package, extracting it, and
running the application itself.
For example, assume you've decided to download the latest stable version of
MongoDB for your 64-bits Windows 2008 server. You begin by extracting the package
( mongodb-win32-x86_64-x.y.x.zip ) to the root of your C:\ drive. At this point, all you
need to do is open a command prompt (Start Run cmd OK) and browse to the
directory you extracted the contents to:
> cd C:\mongodb-win32-x86_64-x.y.z\
> cd bin\
Doing this brings you to the directory that contains the MongoDB executables. That's
all there is to it: as I noted previously, no installation is necessary.
Running MongoDB
At long last, you're ready to get your hands dirty. You've learned where to get the
MongoDB version that best suits your needs and hardware, and you've also seen how to
install the software. Now it's finally time to look at running and using MongoDB.
Prerequisites
Before you can start the MongoDB service, you need to create a data directory for
MongoDB to store its files in. By default, MongoDB stores the data in the /data/db
directory on Unix-based systems (such as Linux and OS X) and in the C:\data\db
directory on Windows.
MongoDB does not create these data directories for you, so you need to create
them manually; otherwise, MongoDB will fail to run and throw an error message. Also, be
sure that you set the permissions correctly: MongoDB must have read, write, and directory
creation permissions to function properly.
Note
If you wish to use a directory other than /data/db or C:\data\db , then you can tell
MongoDB to look at the desired directory by using the --dbpath flag when executing
the service.
 
 
Search WWH ::




Custom Search