MongoDB Environment Preparation

Source: Internet
Author: User
Tags install mongodb mongodb server

1. Installing MongoDB

MongoDB installation is very simple, just need to extract the downloaded MongoDB compressed files to any directory, and add the bin directory to the system's path environment variable can be

2. Start MongoDB

Before you start MongoDB, manually create a directory that holds the MongoDB data files, such as D:\mongo_data

Execute Mongod--dbpath=d:\mongo_data at the command line

tip : Manually create a file with the suffix of bat, file name arbitrary, the content is: Mongod--dbpath=d:\mongo_data, double-click this file to start the MongoDB service, not every time to the command line to execute the start command
You can type ctrl-c to completely stop Mongod running under the shell that starts the server

You can also use the command to install MongoDB as a service:
D:\mongodb\bin\mongod.exe--logpath D:\mongo_log\mongodb.log--logappend--dbpath D:\mongo_data--directoryperdb-- ServiceName MongoDB--install

Remove this service from System services: D:\mongodb\bin\mongod.exe--logpath D:\mongo_log\mongodb.log--logappend--dbpath D:\mongo_data-- Directoryperdb--servicename MongoDB--remove

3. Connect to a MongoDB server

On the command line, you can use the MONGO command to connect to the MongoDB server, as follows, enter the MONGO command to connect to the local database named Test by default, and if you want to connect to a remote database, you can use MONGO Ip:port

MongoDB Environment Preparation

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.