Because the project to use MongoDB, today tried to build a bit.
First MONGO is still very good, yum or manual download, I am the most recent version of Yum installed 3.0.4.
Basically, after the installation is complete, a GUI management tool needs to be installed, and I have tried a lot, all the same. Finally, choose to use Robomongo because this GUI tool has versions on Linux, MAC, and Windows.
I install it on CentOS and then modify the/etc/mongod.conf file after it's installed.
1 27017 2 3 true 4 5 0.0. 0.0
Modify these three lines.
After the problem is on the connection authentication, MongoDB 3.0 later version authentication becomes complex, the connection tool can not connect, must modify the authentication version
>Use Admin switched to DB admin> var schema = Db.system.version.findOne ({"_id":"Authschema"}) > schema.currentversion =3 3>Db.system.version.save (Schema) Writeresult ({"nmatched":1,"nupserted":0,"nmodified":1})
Create the user after the modification is complete. The shell that creates the database user is attached below:
1 Create a root user:
Use Admindb.createuser ( { "superuser", pwd " 12345678 " , " Root " ] })
2 Create Admin user
Use Admindb.createuser ( { "siteuseradmin", pwd "password", "useradminanydatabase " " Admin " } ] })
3 Creating a database-specific user
Use Recordsdb.createuser ( { "recordsuseradmin", PWD"password", "useradmin" "Records" }] })
Finally, we have to certify.
Db.auth ("user""pwd")
Returns 1 for success, 0 for failure.
MongoDB 3.0. More than 3 GUI connection authentication issues