Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

See / setup a user with MongoDB Compass?

Tags:

With MongoDB Compass is it possible to see users for a database or create new ones?

like image 745
Evanss Avatar asked Oct 27 '17 10:10

Evanss


People also ask

How do I view a user in MongoDB?

To list existing users in MongoDB, you can use the db. getUsers() method to show all of the users within the current database.

What is my MongoDB username and password?

By default mongodb has no enabled access control, so there is no default user or password. To enable access control, use either the command line option --auth or security.

How do I find my MongoDB Atlas username and password?

MongoDB Atlas does not have a default user/password combination. To enable access to a cluster you need to: Add a new database user with appropriate permissions.

Where are MongoDB users stored?

For users created in MongoDB, MongoDB stores all user information, including name , password , and the user's authentication database , in the system. users collection in the admin database. Do not modify this collection directly. To manage users, use the designated user management commands.


2 Answers

Ive managed it on the command line with:

mongo use (my database name) db.createUser( { user: "myuser", pwd: "password", roles: ["readWrite"] }) 

However I would still much prefer a GUI to do this.

like image 122
Evanss Avatar answered Sep 24 '22 13:09

Evanss


No, it isn't (at least until version 1.20.4 of Compass)

like image 23
MauriRamone Avatar answered Sep 25 '22 13:09

MauriRamone