MongoDB installation configuration on windows platform

Installation mongodb

1. Download the official website mongoDB: http://www.mongodb.org/downloads

Select the windows platform.

Up next, the establishment of the installation directory. I installed in the D: \ MongoDB \ data directory.

 

2. The establishment of the working directory:

In D: \ MongoDB \ build folder \ db (used to store the database file) data directory

In D: \ MongoDB \ build folder \ log (used to store log files) data directory

 

3. Run cmd.exe, into d: \ MongoDB \ data at \ bin directory.

Execute the following command:

d:\MongoDB\data\bin>mongod -dbpath "d:\MongoDB\data\db"

 

 If the launch is successful, it will show mongoDB default listening port: 27017, mysql is 3306

  In the browser, type http: // localhost: 27017 /

       Will appear:

  It looks like you are trying to access MongoDB over HTTP on the native driver port.

  It indicates that the service has been launched.

 

4. Test connector

  Cmd to open a new window into mongodb bin directory, enter mongo or mongo.exe, the following message appears that testing by this time we have entered the test database. (Premise: Open mongod.exe bin directory)

 

I seem to have some problems here emm

 

5. When mongod.exe is closed, mongo.exe can not connect to the database, so every time you want to use the database must be open mongod.exe mongodb program, it is more trouble, this time we can MongoDB installed as windows service

   Or run cmd, go to the bin folder and execute the following command

  > d:\mongoDB\data\bin>mongod --dbpath "d:\mongoDB\data\db" --logpath "d:\mongoDB\data\log\mongodb.log" --install --serviceName "MongoDB"

       建立了一个mongodb.log文件。成功将MongoDB安装为windows服务了。

 

6.

    >d:\MongoDB\data\bin>net start Mongodb

 

转载博文:

https://www.cnblogs.com/ymwangel/p/5859453.html

Guess you like

Origin www.cnblogs.com/musecho/p/10991645.html