Creating MONGO instances on Linux

Source: Internet
Author: User
Tags connect mongo

1. Prepare two shell windows, one as the server and one as the client

2. Launch an unlicensed MONGO instance in the server window using the instruction

Mongod--dbpath Local Database storage location--bind_ip MONGO bound IP--port Port--journal

3. MONGO instance that was just started on the client connection

MONGO server-bound IP: Port/admin

4. Add an Administrator account

Db.createuser ({'user':' username ' 'pwd'  ' password '"root" })

5. Client exit

Exit

6. Close the service side

CTRL + C

7. Create a MONGO server configuration file

Touch configuration file location

8. Start the MONGO service with a file

Mongod-f Configuration file Location

9. Connect to the MONGO test on the client

MONGO--host MONGO binding IP--port Port-u user name-p password database name

Appendix:

1) Create db

Connect MONGO with an administrator account

Creating databases and Managing users

use  database name Db.createuser ({'user':' username ') pwd ' ' Password ' " ReadWrite " " DbAdmin " ] })

2) configuration file description (Official document)

https://docs.mongodb.org/v3.0/reference/configuration-options/

Creating MONGO instances on Linux

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.