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