mongodb3.6.4 Installation

Source: Internet
Author: User
Tags auth mongodb

Groupadd-g-MongoDB
Useradd-u 801-g MongoDB MongoDB
cd/usr/local/
mkdir MongoDB
CD mongodb/
#mkdir bin
mkdir conf
mkdir Log
mkdir data

cd/root/
wget https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-rhel62-3.6.4.tgz
Tar XF mongodb-linux-x86_64-rhel62-3.6.4.tgz
CD mongodb-linux-x86_64-rhel62-3.6.4
CP */USR/LOCAL/MONGODB
Cd/usr/local
Chown-r Mongodb.mongodb mongodb/

cd/root/
VI. bash_profile
Export Path=/mongodb/bin: $PATH
source. bash_profile

Vim/usr/local/mongodb/conf/mongodb.conf
Logpath=/usr/local/mongodb/log/mongodb.log
Dbpath=/usr/local/mongodb/data
#directoryperdb =true
port=27017
bind_ip=0.0.0.0
Logappend=true
Fork=true
Cpu=true
Auth=true

Netstat-nputl
Mongod-f/usr/local/mongodb/conf/mongodb.conf
Mongod--shutdown-f/usr/local/mongodb/conf/mongodb.conf

Mongo
Db
Show DBS

Use admin
Db.auth ("admin", "xld.2018")
Db.system.users.find ()
Db.createuser ({User: "admin", pwd: "xld.2018", roles:["root"}) Create Super Admin
Db.createuser ({User: "Xwgl", pwd: "xld.2018", roles:[{Role: "DbAdmin", DB: "XWGL"}]}) Create a single database administrator

mongodb3.6.4 Installation

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.