Home > Database > Mysql Tutorial > Centos安装配置mongodb

Centos安装配置mongodb

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-06-07 16:32:55
Original
1053 people have browsed it

首先我们添加Mongodb的源: cd /etc/yum.repos.d/touch mongodb.repovi mongodb.repo 在 mongodb .repo内添加内容: [mongodb-10gen] name=10gen Repository baseurl=http://downloads-distro.mongodb.org/repo/redhat/os/x86_64 gpgcheck=0 enabled=1 然后

首先我们添加Mongodb的源:

<code>cd /etc/yum.repos.d/
touch mongodb.repo
vi mongodb.repo</code>
Copy after login

mongodb.repo内添加内容:

<code>[mongodb-10gen]  
name=10gen Repository  
baseurl=http://downloads-distro.mongodb.org/repo/redhat/os/x86_64  
gpgcheck=0  
enabled=1</code>
Copy after login

然后执行:

<code>yum list|grep mongo</code>
Copy after login

可以看到mongodb的列表了

开始安装:

<code>yum install mongo-10gen mongo-10gen-server</code>
Copy after login

安装完成后,修改配置文件:

<code>vi /etc/mongod.conf</code>
Copy after login

修改:

<code>port = 27017
auth = true</code>
Copy after login

重启服务:

<code>service mongod restart</code>
Copy after login

添加管理用户:

<code>mongo
>use admin
>db.addUser('root','123456')</code>
Copy after login
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template