好得很程序员自学网

<tfoot draggable='sEl'></tfoot>

mongodb 实现远程连接

mongodb远程连接配配置,分以下4步。
1,添加管理员账

?

1

2

3

> use admin

switched to db admin

> db.addUser( 'tank' , 'test' );

2,配置mongodb.conf

?

1

2

#bind_ip = 127.0.0.1   //注释此行

auth = true       //将此行前的注释去掉

 
3,重启mongodb

?

1

/etc/init .d /mongod

4,防火墙开放27017端口

?

1

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

5,测试

mongdb 远程连接

查看更多关于mongodb 实现远程连接的详细内容...

  阅读:34次