MongoDB permission verification (2)

Source: Internet
Author: User

In the previous chapter, I posted MongoDB permission verification. I will briefly introduce some problems that may occur during the creation of verification.

1. run f: \ MongoDB \ bin> mongod -- dbpath F: \ MongoDB \ data -- logpath F: \ MongoDB \ logs \ MongoDB. log -- auth -- install always fails to be created during verification.

Cause: the MongoDB service already exists and cannot be created again. Therefore, if you want to create a new one with -- auth, delete it first.

 

Delete service: F: \ MongoDB \ bin> SC Delete MongoDB

 

 

Stop Service:

F: \ MongoDB \ bin> net stop MongoDB

The MongoDB service has been stopped successfully.

 

Create the service F: \ MongoDB \ bin> mongod -- dbpath F: \ MongoDB \ data -- logpath F: \ MongoDB \ logs \ MongoDB. log -- auth -- install
All output going to: F: \ MongoDB \ logs \ MongoDB. Log

 

Start the service

F: \ MongoDB \ bin> Net start MongoDB
The Mongo dB service is being started.
The Mongo dB service has been started successfully.

 

Go to MongoDB

F: \ MongoDB \ bin> Mongo
MongoDB shell version: 2.0.2-RC1
Connecting to: Test
> Show DBS
Wed Nov 30 13:26:28 uncaught exception: listdatabases failed: {"errmsg": "need
To login "," OK ": 0}

 

Logon required

F: \ MongoDB \ bin> Mongo admin-U sa-P 123

 

Asp.net link string: MongoDB: // SA: 123@127.0.0.1: 27017

MongoDB: // username: password @ IP: Port

Related Article

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.