Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- systemLog:
- destination: file
- path: "/root/mongodb.log"
- logAppend: true
- net:
- port: 25015
- processManagement:
- fork: true
- setParameter:
- enableLocalhostAuthBypass: true
- storage:
- dbPath: /root/mongo_data
- engine: wiredTiger
- mongo --port 25019
- > use admin;
- switched to db admin
- > db.createUser(
- {
- user: "siteUserAdmin",
- pwd: "eqt-dfts-mad-ghbr-ovd-g",
- roles: [{role: "userAdminAnyDatabase", db: "admin"}]
- }
- )
- Successfully added user: {
- "user" : "siteUserAdmin",
- "roles" : [
- {
- "role" : "userAdminAnyDatabase",
- "db" : "admin"
- }
- ]
- }
- > use MyDatabase;
- switched to db MyDatabase
- > db.createUser(
- {
- user: "my_user",
- pwd: "cu-npp-re-jpor-mtw-e-s",
- roles: [
- {role: "readWrite", db: "MyDatabase"},
- {role: "dbAdmin", db: "MyDatabase"}
- ]
- }
- )
- Successfully added user: {
- "user" : "vantage",
- "roles" : [
- {
- "role" : "readWrite",
- "db" : "AdVantage"
- },
- {
- "role" : "dbAdmin",
- "db" : "AdVantage"
- }
- ]
- }
- > use MyDatabase;
- switched to db MyDatabse
- > db.createCollection("demotest")
- { "ok" : 1 }
- > show collections;
- demotest
- > show dbs;
- MyDatabase 0.000GB
- admin 0.000GB
- local 0.000GB
- > exit
- bye
- PROMPT> mongo --host 102.216.73.164 -u my_user -p cu-npp-re-jpor-mtw-e-s --authenticationDatabase MyDatabase --port 25019
- MongoDB shell version: 2.6.6
- connecting to: 102.216.73.164:25019/test
- 2015-05-13T21:03:18.963-0400 Error: 18 { ok: 0.0, errmsg: "auth failed", code: 18 } at src/mongo/shell/db.js:1210
- exception: login failed
Add Comment
Please, Sign In to add comment