Mongo DB
install issue
2. Create DB’s data directory
$\MongoDB 2.6 Standard\bin> md C:\MongoDB\data\db
$\MongoDB 2.6 Standard\bin> md C:\MongoDB\data\db
3. Start Mongo with the specific DB:data
directory (Default is C:\data\db)
$\MongoDB 2.6 Standard\bin> mongod.exe --dbpath C:\MongoDB\data\db
PS. C:\MongoDB\data\db is what we create in step 2.
$\MongoDB 2.6 Standard\bin> mongod.exe --dbpath C:\MongoDB\data\db
PS. C:\MongoDB\data\db is what we create in step 2.
4. Connect
$\MongoDB 2.6 Standard\bin> mongo
$\MongoDB 2.6 Standard\bin> mongo
5. OK, we will make the mongo as a windows
service in the following setup.
6. Create config file
First, we create a Mongo log folder :
$\MongoDB 2.6 Standard\bin> md C:\MongoDB\log
Create a config file and set the log filepath property …
C:\MongoDB>echo logpath=C:\MongoDB\log\mongo.log > C:\MongoDB\mongod.cfg
Set the DB:data directory to the config …
C:\MongoDB>echo dbpath=C:\MongoDB\data\db >> C:\MongoDB\mongod.cfg
First, we create a Mongo log folder :
$\MongoDB 2.6 Standard\bin> md C:\MongoDB\log
Create a config file and set the log filepath property …
C:\MongoDB>echo logpath=C:\MongoDB\log\mongo.log > C:\MongoDB\mongod.cfg
Set the DB:data directory to the config …
C:\MongoDB>echo dbpath=C:\MongoDB\data\db >> C:\MongoDB\mongod.cfg
then add the following settings into
the “mongod.cfg”.
Install the Mongo service
$\MongoDB 2.6 Standard\bin> mongod.exe --config C:\MongoDB\mongod.cfg --install
Start the service
$\MongoDB 2.6 Standard\bin> net start MongoDB
5. Stop the Mongo service
$\MongoDB 2.6 Standard\bin> net stop MongoDB
$\MongoDB 2.6 Standard\bin> net stop MongoDB
6. Remove the service
$\MongoDB 2.6 Standard\bin> mongod.exe –remove
$\MongoDB 2.6 Standard\bin> mongod.exe –remove
7. Reference :
[.NET] 在 Windows 上安裝執行 MongoDB
[.NET] 在 Windows 上安裝執行 MongoDB
沒有留言:
張貼留言