First step: Start the database service
1.cmd into the bin directory of MongoDB
2. Enter: Mongod--dbpath "D:\ylkfSoft\mongoData\data\db" starts the database (the path behind--dbpath is the location of the database data that you randomly create after you install the database, You can also create a new folder to put the log in)
Step two: Operate the database (note: Do not close the cmd window above and reopen a cmd)
1.cmd into the bin directory of MongoDB
2. Enter MONGO to enter the database operation location
Note: MongoDB is just installed with no user name and password
Operation:
1. View all databases show DBS
2. Create a database: Use database name (Note: The database you just created is not visible, you need to insert the data before the line)
3. Insert data: DB. database name. Insert (a map);
Specific study: http://www.runoob.com/mongodb/mongodb-create-database.html
Step three: Add user authentication:
1. Access the database (all databases are accessible to users under the admin database)
Use database name
2. Add Users
Db.adduser ("User name", "password")
Note: If you want to use security authentication, the database boot must be started using-auth, and if you do not use even if you configured the security
Authentication, and no need for secure authentication to access query data
Fourth step: Secure Authentication Start Database
1.cmd into the bin directory of MongoDB
2. Input: Mongod--dbpath "D:\ylkfSoft\mongoData\data\db"--logpath "D:\ylkfSoft\mongoData\data\log\MongDB.log"--auth
Fourth step: Connect Visualizer Mongodbvue
1. Delete the original data
2. "D:\ylkfSoft\mongoData\data\db"
Fifth step: MongoDB database backup
Mongodump-h IP--port Port-u user name-p password-d database-o file exists path
1. Do not set user and password, then remove-u-p
2. If the machine is local, remove the-h-port
3. If backing up all databases, remove the-D
Sixth step: Restore the Database
Mongorestore-h IP--port Port-u user name-p password-d database--drop file exists path
MongoDB Getting Started Operation summary