몽고DB에 새 DB만들고 새계정 등록하기 / How to create new DB of mongoDB and how to create account for that DB

 1. mongoDB에 접속

mongo -u mongodbadmin -p password

> use newDB

> db.createUser({ user: "newdbuser", pwd: "password", roles: [ "readWrite" ] })

Successfully added user: { "user" : "pusangpruser", "roles" : [ "readWrite" ] }

> db.createUser({ user: "newdbadmin", pwd: "password", roles: [ "dbAdmin" ] })

Successfully added user: { "user" : "pusangpradmin", "roles" : [ "dbAdmin" ] }


후에 mongodb url로 접속

mongodb://newdbuser:password@127.0.0.1:27017/newDB


Comments

Popular posts from this blog

[VS2010][VS2015] "stdafx.h 을 포함 소스를 찾을 수 없습니다" 에러 해결법

WD mycloud Gen2 hard drive replacement and initialization