Database Reference
In-Depth Information
4. Create a folder called
db
within the
data
folder. Your file structure should
reflect that shown below.
/
mongodb
...
data
db
3.2.2
Running MongoDB on Windows
1. Open the command prompt and move to the directory above the
mongodb
folder.
2. Run the command
mongodb\bin\mongod.exe-dbpath data\db
3. If Windows prompts you, make sure to allow MongoDB to communicate on
private networks, but not public ones. Without special precautions, MongoDB
should not be run in an open environment.
4. Open another command window and move to the directory where you put the
mongodb
folder.
5. Run the command
mongodb\bin\mongo.exe
. This is the command-line
interface to MongoDB. You can now issue commands to MongoDB.
Installing MongoDB on Mac OS X
®
3.2.3
1. Obtain
the
latest
version
of
MongoDB
from
2. Rename the downloaded file to
mongodb.tgz
.
3. Open the “Terminal” application. Move to the folder where you downloaded
MongoDB.
4. Run the command
tar -zxvf mongodb.tgz
. This will create a folder with
the name
mongodb-osx-[platform]-[version]
in the same directory.
For version 2.4.4, this folder will be called
mongodb-osx-x86_64-2.4.4
.
5. Run the command
mv -n mongodb-osx-[platform]-[version]/
mongodb
. This will give us a more convenient folder name.
6. Run the command
mkdir data && mkdir data/db
. This will create the
subfolders where we will store our data.