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

Centos安装配置mongodb

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOriginal
2016-06-07 16:32:551056browse

首先我们添加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>

mongodb.repo内添加内容:

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

然后执行:

<code>yum list|grep mongo</code>

可以看到mongodb的列表了

开始安装:

<code>yum install mongo-10gen mongo-10gen-server</code>

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

<code>vi /etc/mongod.conf</code>

修改:

<code>port = 27017
auth = true</code>

重启服务:

<code>service mongod restart</code>

添加管理用户:

<code>mongo
>use admin
>db.addUser('root','123456')</code>
Statement:
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