Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- use admin
- var admin = {
- user:"admin",
- pwd:"123456",
- roles:[
- {
- role: "userAdminAnyDatabase",
- db:"admin"
- }
- ]
- }
- db.createUser(admin)
- systemLog:
- destination: file
- path: /Users/me/Web/blog/setup/logs/mongodb/mongo.log
- logAppend: true
- storage:
- dbPath: /usr/local/var/mongodb
- net:
- port: 27017
- bindIp: 127.0.0.1
- security:
- authorization: enabled
- mongo 127.0.0.1:27017 --authenticationDatabase admin -u admin -p
- MongoDB shell version: 3.2.5
- Enter password:
- connecting to: 127.0.0.1:27017/test
- 2018-05-11T08:50:53.908+0300 E QUERY [thread1] Error: Authentication failed. :
- DB.prototype._authOrThrow@src/mongo/shell/db.js:1441:20
- @(auth):6:1
- @(auth):1:2
- exception: login failed
Add Comment
Please, Sign In to add comment