下载:
wget https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-rhel62-3.2.4.tgz
tar -zxvf mongodb-linux-x86_64-rhel62-3.2.4.tgz
安装目录:/data/mongodb3.2.4
mkdir data
midkr log
touch log/mongodb.log
配置:
vi conf/mongodb.conf
填写如下内容:
port=10001
dbpath=data/
logpath=log/mongodb.log
logappend=true
fork=true
启动:
./bin/mongod -f conf/mongodb.conf
客户端连接:
./mongo 127.0.0.1:10001
添加用户:
use admin
db.createUser({user:'root',pwd:'mozer0731',roles:['userAdminAnyDatabase']})
db.system.users.find()