티스토리 뷰

728x90
mongosh
use admin
db.createUser({ user: "user" , pwd: "1234", roles: [ "readWrite", "dbAdmin" ] })

use metadata
db.createCollection("product")

# mongodb://user:1234@localhost:27017/metadata

https://stackoverflow.com/questions/22418052/connect-to-a-specific-database-by-default-in-mongodb/74636800#74636800

 

Connect to a specific database by default in mongodb

I am running a mongodb on a linux box. So every time I connect to it from the console (typing mongo) I get something like this: MongoDB shell version: 2.4.9 connecting to: test And then I am doin...

stackoverflow.com

https://www.folkstalk.com/2022/09/mongodb-default-user-password-with-code-examples.html

 

Mongodb Default User Password With Code Examples

Mongodb Default User Password With Code Examples In this tutorial, we will try to find the solution to Mongodb Default User Password through programming. The following code illustrates this. By default mongodb has no enabled access control, so there is no

www.folkstalk.com

 

728x90

'공부' 카테고리의 다른 글

[jenkins] pipeline  (0) 2022.12.01
[terraform] basic  (0) 2022.12.01
[spark] static column `df.withColumn('new_column', lit(10))`  (0) 2022.12.01
[python] locals()  (0) 2022.12.01
[python] arg_keys in method `inspect.getfullargspec({method})[0]`  (0) 2022.12.01
댓글