MongoDB Installation and MongoDB service configuration __mongodb

Source: Internet
Author: User
Tags mongodb

Installation and MongoDB service configuration for MongoDB
Mongo DB is a kind of non relational database (NOSQL) which is very popular in the IT industry, and its flexible data storage is favored by the current IT practitioners. Mongo db is a good way to implement object-oriented thinking (OO), where each record in Mongo DB is a document object. The biggest advantage of Mongo DB is that all data persistence operations require no developer to manually write SQL statements, and the direct invocation of the method makes it easy to implement CRUD operations.
First, Installation:
1. Official website: http://www.mongodb.org/downloads, download the corresponding system of the 32/64-bit MSI format installation package
2. Installation path: Example D:\MongoDB (path optional, but not too deep)
3. Configuration after installation:
Create a new Data folder under D:\MongoDB\
Create a new DB and log folder under D:\MongoDB\data
Create a new MongoDB.log file under D:\MongoDB\data\log
Second, start:
1. Entering D:\MongoDB\bin, enter:
1 Mongod–dbpath D:\MongoDB\data\db
Role: Create a MongoDB database file to the D:\MONGODB\DATA\DB directory
At this point the interface will stop
2016-10-26t14:55:37.044+0800 I Network [Initandlisten] waiting for connections on port 27017
The database is now started.
2. Open a new CMD window, run Mongo.exe program, this time before a window display
2016-10-26t14:56:05.855+0800 I Network [Initandlisten] connection accepted from 127.0.0.1:60584 #1 (1 connection now OPEN)
You can now use the MongoDB database.
Third, the use of:
1. In the cmd window where you previously ran Mongo.exe, enter the use TestDB to create the TestDB database.
2. Enter Db.adduser ("Test", "123") to create a user for TestDB
Note: The V3 version MongoDB is no longer using adduser, but it uses the Db.createuser
1
2
3
4
5
6
7 Db.createuser (
{
User: "Accountuser",
PWD: "Password",
roles: ["ReadWrite", "Dbadmin"]
}
)

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.