mkdir -p /data/node/ touch /data/mongodb.log
tar zxf mongodb-linux-x86_64-2.4.9.tgz mv mongodb-linux-x86_64-2.4.9 /opt/mongodb echo "export PATH=$PATH:/opt/mongodb/bin" >>/etc/profile source /etc/profile
cat >> ~/.mongodb.conf <<EOF
fork = ture port = 11000 dbpath = /data/node logpath = /data/mongodb.log logappend = true EOF
mongod --config ~/.mongodb.conf
mongodb-win32-x86_64-2008plus-2.4.9.zip
# mongod -f d:\mongodb\mongodb.cfg --serviceName MongoBD --install
# net start mongodb
# mongod --remove
mongodb.cfg --> logpath=d:\data\mongo.log dbpath=d:\data logappend=true auth=true #fork=true
# mongod --config ~/.mongodb.conf cat > ~/.mongodb.conf <<EOF
port = 10001 fork = true logpath = /data/mongodb.log dbpath = /data/node2 logappend = true EOF
> use admin > db.shutdownServer();
MongoDB shell version: 2.4.9
connecting to: 127.0.0.1:10001/test
> db.runCommand({serverStatus : 1})
> use admin
switched to db admin
> db.addUser("root", "root123");
{
"user" : "root",
"readOnly" : false,
"pwd" : "81c5bca573e01b632d18a459c6cec418",
"_id" : ObjectId("530bd17622cceb4323a2b500")
}
> use test
switched to db test
> db.addUser("test_user", "root123", true);
{
"user" : "test_user",
"readOnly" : true,
"pwd" : "d436badec207e3821abbaf337fcbdd06",
"_id" : ObjectId("530bd24322cceb4323a2b501")
}
> use admin
switched to db admin
> db.auth("root", "root123");
1
> use admin
switched to db admin
> db.system.users.find();
{ "_id" : ObjectId("530bd17622cceb4323a2b500"), "user" : "root", "readOnly" : false, "pwd" : "81c5bca573e01b632d18a459c6cec418" }
db.system.users.remove({"user":"root"});
机械节能产品生产企业官网模板...
大气智能家居家具装修装饰类企业通用网站模板...
礼品公司网站模板
宽屏简约大气婚纱摄影影楼模板...
蓝白WAP手机综合医院类整站源码(独立后台)...苏ICP备2024110244号-2 苏公网安备32050702011978号 增值电信业务经营许可证编号:苏B2-20251499 | Copyright 2018 - 2025 源码网商城 (www.ymwmall.com) 版权所有