centos7 下安装mongodb指南;

时间:2022-10-14 17:33:42
1.下载:https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-rhel70-3.4.1.tgz; 2.解压缩; 3.文件存储在mongodb文件夹下面,再新建: 3.1 mongodb\data\db;         3.2 mongodb\logs 4.ps aux |grep mongodb centos7 下安装mongodb指南; 

centos7 下安装mongodb指南;
2017-02-14T15:59:04.556+0800 I CONTROL  [initandlisten] 
> show dbs;
admin  0.000GB
local  0.000GB
> use ****
switched to db ****
> db.movies.insert({'abc':"abc"});
WriteResult({ "nInserted" : 1 })
> db.createUser({user:'****',pwd:'****',roles:[{role:'dbOwner',db:'*****'}]})
Successfully added user: {
    "user" : "****",
    "roles" : [
        {
            "role" : "dbOwner",
            "db" : "****"
        }
    ]
}