At this stage, work relatively not busy, in learning Angularjs+express4+mongodb, last week set up express4+angularjs11.10 =============== MongoDB's Learning mongodbwindows database Cmdservice
1. Download MongoDB version of Windows, there are 32-bit and 64-bit version, according to the system download,:http://www.mongodb.org/downloads
2. Unzip to E:/mongodb
3. Create a storage location for the database files, such as e:/mongodb/data/db. You must create a storage folder for the database files before you start the MongoDB service, otherwise the command will not be created automatically and cannot start successfully. The default folder path is c:/data/db. When you use the System default folder path, the startup service does not need to add--dbpath parameter descriptions, but folders are also created manually
4. Open the cmd command line, enter the E:/mongodb/bin directory, enter the following command to start the MongoDB service:
E:/mongodb/bin>mongod.exe--dbpath e:/mongodb/data/db
Show:
Indicates a successful start, the last few lines of the database port and the Web port, the default is 27017, open http://localhost:27017in the browser, you can see some information about it.
You can modify the database port by adding the parameter--port: E:/mongodb/bin>mongod.exe--port 10001--dbpath d:/mongodb/data/db
5. Open a cmd input: E:/mongodb/bin>mongo, or double-click Mongo.exe, you can do the client command operation of MongoDB, under test
MongoDB creates a test database by default
6. So it's inconvenient to start mongodb every time, we can use it as a Windows service like MySQL, so it's much easier.
The way to install MongoDB Windows Services is to create the logs directory under the MongoDB installation directory and then enter it on the cmd command line
E:/mongodb/bin>mongod--logpath D:/mongodb/logs/mongodb.log--logappend
--dbpath d:/mongodb/data/db--directoryperdb--servicename MongoDB--install
Show:
10t10:21:41.499+0800 Trying to install Windows service ' MongoDB '
2014-11-10t10:21:41.768+0800 Service ' MongoDB ' (MONGODB) installed with command line ' E:\mongodb\bin\mongod.exe-- LogPath E:\mongodb\logs\mongodb.log--logappend--dbpath E:\mongodb\data\db--directoryperdb--service '
2014-11-10t10:21:41.768+0800 Service can started from the command line with ' net start MongoDB '
Indicates that the service was created successfully.
The command line specifies the log file:/logs/mongodb.log, the log is output in an append manner;
Data file directory:/data/db, and the parameter--directoryperdb indicates that each DB will create a new directory;
Name of the Windows service: MongoDB;
The above three parameters can be determined according to their own circumstances.
Finally, the installation parameters:--install, the opposite is--remove
7, you can start and stop MongoDB under cmd with command net start MongoDB and net stop MongoDB, also can see in the Local service
Manage the service through the interface.
Transfer from http://blog.csdn.net/liuzhoulong/article/details/6124566
Angularjs+express4+mongodb Learning "two"