MongoDB learning notes 01 MongoDB installation and use, mongodb learning notes
Recently, due to work needs, I began to contact mongodb, so I began to study mongodb. The first step of the study was naturally from installation and use. there will certainly be more research and study in the future, so I plan to take a series of relevant notes for future study.
1. Installation in Windows
1) Version Download
MongoDB: http://www.mongodb.org/downloads
Download the corresponding version. Here I download 64-bit.
The installation process is very simple. Similar to the installation of common software, most of them are Next. During the installation process, the customs type is selected, and the custom installation directory is D:/MongoDB.
OK. The MongoDB installation is complete until the finished step is finished.
2) set the data file path
Create a logs and data folder in D: \ MongoDB
Create a MongoDB. log File in D: \ mongodb \ logs.
2. Configure the Mongo Server:
Go to the D: \ MongoDB \ bin directory, press the shortcut key Ctrl + Shift, and right-click the directory. The right-click menu will display the following options:
Click to open the command line window and directly go to the corresponding directory
Enter the following command:
Mongod -- dbpath D: \ MongoDB \ data -- logpath = D: \ MongoDB \ logs \ mongodb. log -- install
Press enter to complete installation
Enter net start mongodb in the command line, and press enter to start mongodb.
What should I do if an error occurs after MongoDB is installed?
Install? What do you mean by installing MongoDB?
Generally, MongoDB in windows only needs to Extract files from the official website. What you need to do is to start the MongoDB service. The mongodbservice refers to the startup of mongod.exe in the bindirectory. Then, you can access this service using mongodb's client shell, that is, the cmd.exe in the bindirectory.
To sum up, I think the possible reasons are:
1. This is definitely the case. If you haven't started the MongoDB service, use bin/mongod to start it.
2. Has the default port changed? By default, MongoDB uses 27017. If you change this startup configuration, such as using bin/mongod-por 27000, then you have to use bin/mongo-port 27000 to connect.
3. If mongod reports an error at startup, you must send the log to handle it.
Mongodb learning materials and videos
You can buy this MongoDB authoritative guide. This is the only mongodb tutorial that can be translated into Chinese.
You can find the driver on www.mongodb.org. Mongodb supports drivers in many languages, but the documentation is in English. You must have a certain degree of English Reading Capability, because many problems may occur during the driver process, if you do not check the document, you must be blind.