日期:2014-05-16 浏览次数:20426 次
mongod --dbpath=D:\mongdb\mongodb-win32-i386-2.0.7-rc1\mongodb-win32-i386-2.0.7-rc1\data --port 27017
telnet 127.0.0.1 27017
C:\Users\worina>mongo MongoDB shell version: 2.0.7-rc1 connecting to: test C:\Users\worina>use admin --切换成admin数据库 switched to db admin > db.addUser('test','test') { "n" : 0, "connectionId" : 1, "err" : null, "ok" : 1 } { "user" : "test", "readOnly" : false, "pwd" : "a6de521abefc2fed4f5876855a3484f5", "_id" : ObjectId("50232822bedcbbc57a2d98bc") }
db.system.users.remove({'users':'test'})
./mongod --dbpath=../data/db/27017/ --logpath=../data/log/27017/mongodb.log --logappend --port 27017 &
./mongod --dbpath=../data/db/27018/ --logpath=../data/log/27018/mongodb.log --logappend --port 27018 &
./mongod --port 27018 --dbpath=../data/db/27018 --shutdown