Home > Database > Mysql Tutorial > mongodb 远程连接 详解

mongodb 远程连接 详解

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-06-07 16:32:59
Original
1182 people have browsed it

mongodb远程连接配配置,分以下4步。 1,添加管理员账 use adminswitched to db admin db.addUser('tank','test'); 2,配置mongodb.conf #bind_ip = 127.0.0.1 //注释此行auth = true //将此行前的注释去掉 3,重启mongodb /etc/init.d/mongod 4,防火墙开放270

mongodb远程连接配配置,分以下4步。

1,添加管理员账

> use admin
switched to db admin
> db.addUser('tank','test');
Copy after login

2,配置mongodb.conf

#bind_ip = 127.0.0.1     //注释此行
auth = true              //将此行前的注释去掉
Copy after login

3,重启mongodb

/etc/init.d/mongod
Copy after login

4,防火墙开放27017端口

iptables -A INPUT -p tcp -m state --state NEW -m tcp --dport 27017 -j ACCEPT
Copy after login

5,测试

mongdb 远程连接

mongdb 远程连接

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
Latest Issues
mongodb start
From 1970-01-01 08:00:00
0
0
0
linux - ubuntu14 error installing mongodb
From 1970-01-01 08:00:00
0
0
0
Use of symfony2 mongodb
From 1970-01-01 08:00:00
0
0
0
mongodb _id rename
From 1970-01-01 08:00:00
0
0
0
Parameter understanding of mongodb
From 1970-01-01 08:00:00
0
0
0
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template