[MongoDB] Serveral common command of MongoDb, mongodbserveral
In the recent days, since the overwork made me exhaused, on arrival to home I will go to bed, which leads to loss of blogs that shoshould have been written in the past days.
Now I make a summay to all the commond of operating mongoDB.
First, you shoshould run the mongoDB server. if the following picture exists, it means you has run the mongoDB successfully.
Secondly, after run the mongodb server, next shoshould execute the mongodb client.
Thirdly, we input the db. help command, we will find all the method to operate database/
In the above picture, it; s generally used in the development.
Notes, in the mongodb, there is no command like mysql ('create database XXX'), instead use command 'use dbname' to create a new db;
Lastly I set a simple exampe to show usage of some command.
An error 1067 is reported when mongodb starts the service. The process is terminated unexpectedly.
I have encountered a similar problem before. My personal analysis is a data problem. I checked the information on the Internet and said I would delete mongod. the lock file can be restarted, but the above problem still occurs on my machine.
If you have been doing well before, just because the data is inserted and the service cannot be used, the solution to the problem is very simple, and the data you just copied and mongod. delete lock files (all in the data folder ). It may be because a folder in the mongodb-win32-i386-2.2.1 version has the data you just copied in, and data duplication causes only deleting mongod. lock to fail to start.
Note: When mongodb is in the mongodb-win32-i386-2.2.1 version, the data stored in the data folder will create its own folder (previously saved directly in. ns. 0. 1 format under the data folder ).
This is my own method. I cannot analyze the specific cause. I hope this will help you.
Mongodb cannot be started, and cannot be connected because the target computer is actively rejected.
This is not because mongodb cannot be started. If you haven't started mongodb, you can connect to it and use it. It is definitely not successful.
Run mongod -- dbpath XXXX/data in the bin directory of mongodb to start mongodb, and then connect to mongodb.