Mongo Configuration

Create admin user:

Connect with mongo command, then type use admin.

After run db.createUser({user: “mongo”, pwd: “mongo”, roles: [“userAdminAnyDatabase”]});

the new user you set is mongo and password mongo but you can choose what you want.

use these command:

show collections
use admin    ->   db.system.namespaces.find()
show dbs
backup all db command
singole database

mongodump –host –port 27017 –db db–out ./db.dump

restore db command

mongorestore /db databasename /dir:dir.dump/db/


Leave a Reply