MongoDB Local Installation and enablement (Windows)

Source: Internet
Author: User

MongoDB Installation with MongoDB service configurationMongo DB is a non-relational database (NOSQL) that is currently very popular in the IT industry, and its flexible data storage methods are highly favored by current it practitioners. Mongo DB is a good implementation of object-oriented thinking (Oo idea), in Mongo db each record is a document object. The biggest advantage of Mongo DB is that all data persistence requires no developers to write SQL statements manually, and it is easy to invoke methods to implement CRUD operations.

First, Installation:

1. Official website: http://www.mongodb.org/downloads, download the 32/64-bit MSI format installation package for the corresponding system

2. Installation path: Example D:\MongoDB (path optional, but not too deep)

3. Installed configuration:

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. Go to D:\MongoDB\bin and enter:

1 mongod --dbpath D:\MongoDB\data\db

Role: Create a MongoDB database file into the D:\MONGODB\DATA\DB directory

The interface will now stop at

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 the Mongo.exe program, at which time the previous window displays

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, use:

1. Enter MONGO into the MONGO command interface and enter the use TestDB to create the TestDB database.

2. Enter Db.adduser ("Test", "123") to create a user for TestDB

Note: V3 version MongoDB no longer uses adduser, but instead uses the Db.createuser

Db.createuser (   {     User: "Accountuser",     pwd: "Password",     roles: ["ReadWrite", "DbAdmin"]   })

MongoDB Local Installation and enablement (Windows)

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.