Windows installation configuration MongoDB and graphics tools Mongovue

Source: Internet
Author: User
Tags auth connect to mongodb server create mongodb mongodb server

Official Downloads

Unpack the installation package to E:\mongodb

Set up the database directory E:\mongodb\data

Create log directory E:\mongodb\logs

Create profile Directory E:\mongodb\etc

Setting up the configuration file E:\mongodb\etc\mongodb.conf
The contents are as follows:

#数据库路径
Dbpath=e:\mongodb\data
#日志输出文件路径
Logpath=e:\mongodb\logs\mongodb.log
#错误日志采用追加模式, after configuring this option, the MongoDB log is appended to the existing log file instead of creating a new file
Logappend=true
#启用日志文件, enabled by default
Journal=true
#这个选项可以过滤掉一些无用的日志信息, set to False if you need to use Debug
Quiet=true
#端口号 defaults to 27017
port=27017

Normal Startup
Mongod--config E:\mongodb\etc\mongodb.conf

Add to Windows Service

Sc.exe create MongoDB binpath= "\" E:\mongodb\bin\mongod.exe\ "--service--config=\" E:\mongodb\etc\mongodb.conf\ "" Displayname= "MongoDB 2.6 standard" start= "Auto"

Note: There are spaces after the binpath equals sign, and no spaces after the--config equals sign \ "
When a log file is specified, the log is output to the specified log file, regardless of whether the configuration file is specified or specified on the command line, and no log output is visible at the command line interface


http://localhost:27017/

Connect to MongoDB
A new command-line control window opens, using Mongo.exe to connect to MongoDB Server.

Setting up MongoDB for Windows services

The command to start MongoDB is: net start MongoDB

The command for parking MongoDB is: net stop MongoDB

The command to delete MongoDB is: Mongod--remove


MONGO Introduction--Implement authorized Login

MONGO is used by default and is not required to provide a user name and password when accessing the database.
However, we are generally authorized to access the.
We need to do the following.

After starting Mongod, execute the following command
Use admin;//This is the built-in Administrator database
Db.adduser (' root ', ' 123456 ');//Add a user name and password to the admin database are root users, root as a super Admin user
Show collections;//Run this command to see a collection of system.indexes and System.users two
Use working_collection//into the working database
Db.adduser (' Test ', ' 123456 ');
Show collections;//Run this command and see the system.indexes and System.users two collections
This completes the Super Administrator privilege for the entire Mongod and the administrator permissions on a database.
If you want to use authorization to access the working database, you need to start the Mongod or MongoDB service using the--auth parameter, and then execute the following command
Use Working_collection
Db.auth (' Test ', ' 123456 ')
As can be seen from the above command, MONGO is individually licensed for each database. If you want to log on only once when accessing multiple databases,
You can log in using the account under the Admin database and which database to use when using the database.

Second, Mongovue
1. Download: Http://www.mongovue.com/Installer-1.6.9.zip
2, installation can

Windows installation configuration MongoDB and graphics tools Mongovue

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.