Running MongoDB under Linux

Source: Internet
Author: User
Tags install mongodb yum install mongodb

A "download

1. go to the MongoDB website drop- down box to find linux =>rhel 6 =

Package Manager:

2.Instructions for installing with Yum

3. Click the (2) Link to find the 3.4 version copy

4. Enter /etc/yum.repos.d/ new mongodb.repo file in the Yum repository

Open the Yum Warehouse command Yum

Enter file cd/etc/yum.repos.d

new file (not folder)VI Mongodb.repo

Enter edit mode a

5. paste The contents of the 3.4 version : w Save:q exit

Install MongoDB database : yum install mongodb* or sudo yum install-y mongodb-org

add: See if MongoDB installation is successful command chkconfig can see mongod

6. Simple operation of MongoDB under Linux

Learn mongodb website:http://www.runoob.com/mongodb/mongodb-create-database.html

to view the running status of MongoDB:service Mongod status

Open MongoDB:service Mongod start

Stop MongoDB:service Mongod restart

into the MongoDB database:MONGO

Show all databases:show DBS

adding or using that database GHF:useGHF

Show current database:db

add: Insert Datato GHF: Db.ghf.insert ({"Name": " Rookie tutorial "})

By deleting:

Change :

check: Show all data for GHF:db.ghf.find ()

Running MongoDB under Linux

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.