2.解压缩;
3.文件存储在mongodb文件夹下面,再新建:
3.1 mongodb\data\db;
3.2 mongodb\logs
4.ps aux |grep 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" : "****"
}
]
}
>
> 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" : "****"
}
]
}
>