1
votes

I added a user as below.

db.createUser( { user: "Username", pwd: "Password", roles: [ { role: "root", db: "admin" } ] } )

But when I create DB with this user, db gets deleted automatically and does not appear in next session.

I checked log and found out that a command runs through CMD to delete my DB.

Can someone please advise if something is wrong with the user?

1
I'm assuming you restarted the mongo daemon with the --auth option after creating the user. What do you mean by "create DB"? Do you add records to a collection? Also, can you provide relevant parts of the mongodb logs?AxxE
Thanks. But there was nothing wrong with user role or anything else. My MongoDB server got hacked.Umar shareef

1 Answers

0
votes

There was nothing wrong with user role or anything else. My MongoDB server got hacked.