Home Database Mysql Tutorial mongodb 远程连接 详解

mongodb 远程连接 详解

Jun 07, 2016 pm 04:32 PM
mongodb Detailed explanation Remotely connect

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

Hot Article Tags

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

Which version is generally used for mongodb? Which version is generally used for mongodb? Apr 07, 2024 pm 05:48 PM

Which version is generally used for mongodb?

The difference between nodejs and vuejs The difference between nodejs and vuejs Apr 21, 2024 am 04:17 AM

The difference between nodejs and vuejs

Detailed explanation of division operation in Oracle SQL Detailed explanation of division operation in Oracle SQL Mar 10, 2024 am 09:51 AM

Detailed explanation of division operation in Oracle SQL

How to connect OnePlus watch to Bluetooth headset_How to connect OnePlus watch to Bluetooth headset How to connect OnePlus watch to Bluetooth headset_How to connect OnePlus watch to Bluetooth headset Mar 23, 2024 pm 01:16 PM

How to connect OnePlus watch to Bluetooth headset_How to connect OnePlus watch to Bluetooth headset

What are the advantages of mongodb database What are the advantages of mongodb database Apr 07, 2024 pm 05:21 PM

What are the advantages of mongodb database

Where is the database created by mongodb? Where is the database created by mongodb? Apr 07, 2024 pm 05:39 PM

Where is the database created by mongodb?

Steps to connect game controller to Gohan Arcade Steps to connect game controller to Gohan Arcade Mar 19, 2024 pm 03:55 PM

Steps to connect game controller to Gohan Arcade

Detailed explanation of the role and usage of PHP modulo operator Detailed explanation of the role and usage of PHP modulo operator Mar 19, 2024 pm 04:33 PM

Detailed explanation of the role and usage of PHP modulo operator

See all articles