本文共 593 字,大约阅读时间需要 1 分钟。
本文介绍通过yum安装mongodb
[root@server init.d]# cd /etc/yum.repos.d/[root@server yum.repos.d]# vi mongodb.repo [MongoDb]name=mongo repobaseurl=http://repo.mongodb.org/yum/redhat/$releasever/mongodb-org/3.4/x86_64/gpgcheck=0enabled=1
yum install mongodb-org
验证版本:
systemctl start mongod.service
> show dbs;admin 0.000GBlocal 0.000GB> use lenovodbswitched to db lenovodb> db.user.save({name:'feiy',mobile:'15011186301'})WriteResult({ "nInserted" : 1 })> db.user.find(){ "_id" : ObjectId("5881c3d15528faa7b424d028"), "name" : "feiy", "mobile" : "15011186301" }> exit