MongoDB Installation
Wget http://fastdl.mongodb.org/linux/mongodb-linux-x86_64-2.0.4.tgz
Tar-zxvf/home/download/mongodb-linux-x86_64-2.0.4.tgz-C/home/MongoDB/
Mkdir-P/data/DB
Useradd-G MongoDB
Passwd MongoDB
Daemon
/Home/MongoDB/mongodb-linux-x86_64-2.0.4/bin/mongod -- dbpath =/data/DB/-- logpath =/home/MongoDB/log/MongoDB. log -- fork -- auth
Shutdownserver ();
By default, MongoDB does not need to verify the user name and password. You can directly connect to MongoDB after it is started. All databases have the root permission.
Therefore, the user name and password must be specified during startup.
Remember to add -- auth at startup. Start the verification module.
Add users:
DB. adduser ("test", "test ")
DB. Auth ("test", "test ");
Connect to database
/Home/MongoDB/mongodb-linux-x86_64-2.0.4/bin/mongo-u ovproot-P fophaop0923 10.181.49.195/freeovp
Http://database.51cto.com/art/201105/263921.htm
Note: MongoDB permissions are for databases. The permission set in Admin takes effect only in Admin. Therefore, you must set permissions when creating a database.