- Install Mongo , for mac use
brew install mongo
. If using OSX Sierra (latest version) try to install manually from https://docs.mongodb.com/v3.0/tutorial/install-mongodb-on-os-x/ - Install a User Interface Admin, MongoHub: https://github.com/jeromelebel/MongoHub-Mac
Create a folder to store the database, so in you console run:
Mac and Linux users:
- sudo mkdir /data
- sudo mkdir /data/db
Then change the owner using your user, changin the username
for your username
- sudo chown username /data/db
Windows:
- md \data\db
Then you can run in your terminal mongod
, check after if you have something like mongo is listening to port 27017
Now connect to mongodb using your root user:
sudo mongo
Inside the console that just opened, type this
use admin
db.createUser(
{
user: "siteUserAdmin",
pwd: "password",
roles: [ { role: "userAdminAnyDatabase", db: "admin" } ]
}
)
Now you have a username siteUserAdmin
with password password
that can do anything in mongo database.
Open your MongoHub, click on the add icon, give a name localhost
, put the username siteUserAdmin
and password password
.
When you save will show a localhost icon, double click, then in the new screen click on add , so you can create a new database.
After you create, right click in the database name and choose New Collection, give a name for that as well. Now if you right click the collection name, you can add/remove/update new items.