Installing MongoDB
sudo apt-get install MongoDB
sudo apt-get install MongoDB
Close/Start
sudo service MongoDB stop
sudo service MongoDB start
To set the database connection password:
Creating a folder with directory: data/db
Close the existing service.
sudo service MongoDB stop
Restart Service
$ mongod–auth
Create a connected user
$ MONGO
> Use admin
Switched to DB admin
> Db.adduser ("Root", "1983")
Close the Service ( Command window launched directly in Mongod "CTRL + C")
Restart Service:
$: Mongod–auth
To see if validation starts:,
$ MONGO
MongoDB Shell version:2.0.4
Connecting To:test
> Use admin
Switched to DB admin
> Show Collections
Fri Mar 09:07:08 uncaught exception:error: {
"$err": "Unauthorized db:admin lock Type:-1 client:127.0.0.1",
"Code": 10057
}
There is a hint link error.
For user authentication:
> Db.auth ("Root", "1983")
1
Re-view to view datasets
> Show Collections
System.indexes
System.users
To set up a client connection:
The default installation allows only 127.0.0.1 IP connections.
The following records need to be modified/etc/mongodb.conf comments:
Open File:
$ sudo gedit/etc/mongodb.conf
Note Record:
#bind_ip = 0.0.0.0
Installation and configuration of MongoDB under Ubuntu system