Introduction and installation of the MongoDB database

Source: Internet
Author: User
Tags auth mongodb create database linux

1. Installation Preparation

[Root@chen download]# tar zxvf mongodb-linux-x86_64-2.2.0.tgz

[Root@chen download]# CP Mongodb-linux-x86_64-2.2.0/usr/local/mongodb-r

2. Create database folders and log files

[Root@chen download]# Mkdir/usr/local/mongodb/data

[Root@chen download]# Touch/usr/local/mongodb/logs

Set up startup

Add MongoDB Startup items to rc.local guarantee MongoDB start when server is powered on

[Root@chen download]# echo "/usr/local/mongodb/bin/mongod--dbpath=/usr/local/mongodb/data–logpath=/usr/local/ Mongodb/logs–logappend--auth–port=27017 ">>/etc/rc.local

Start MongoDB

CD to the MongoDB directory in the Bin folder boot MongoDB

Here is the login method that requires permission, user name and password to connect

[Root@chen download]#/usr/local/mongodb/bin/mongod--dbpath=/usr/local/mongodb/data--logpath=/usr/local/mongodb/ Logs--logappend--auth--port=27017--fork

This one doesn't need a password.

[Root@chen download]#/usr/local/mongodb/bin/mongod--dbpath=/usr/local/mongodb/data--logpath=/usr/local/mongodb/ Logs--logappend--port=27017--fork

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.