Directory:

  1. Download address
  2. The installationMongodbsteps
  3. runMongodbService steps
  4. Visualization toolRobo 3TThe use of

A, download address, referencewebsite

Installation environment

Mongodb: Windows 10 (64-bit) mongodb: V3.0.7 (64-bit)# mongo --version checkRobo 3T: 1.1.1.0 (64-bit)# Install directory view properties --> details
Copy the code

2. Install Mongodb

Mongodb is a non-relational database

2.1. After decompression, the directory is as follows

2.2 In the mongodb directory, add the following three foldersdata,etc,logsThe complete table of contents is as follows

The role is as follows

mongodb # home folder
data Use to store database
etc # used to store configuration files
logs Mongodb log file exists
bin # mongodb execution fileThe GNU AGPL - 3.0 README THIRD - PARTY - NOTICESCopy the code

2.3. Create the configuration file mongo.conf with the following contents (note: dbpath and logpath). This is based on your folder path)

dbpath=G:\Tool\MongodbTool\mongodb\data # database path
logpath=G:\Tool\MongodbTool\mongodb\logs\mongo.log Path to the log output file
logappend=true Error logging is append mode
journal=true # Enable log files
quiet=true # This option can filter out useless log information. Set it to false if you need to debug it
port=27017 The default port number is 27017
Copy the code

Store in this directory

3. Steps for running the Mongodb service

3.1 Global Implementation To use the mongodb command, you must configure the PATH environment

3.2 path: Control panel \ system and Security \ system

3.3. Add the mongodb service

mongod --dbpath "G:\Tool\MongodbTool\mongodb\data\db" --logpath "G:\Tool\MongodbTool\mongodb\logs\MongoDB.log" --install --serviceName "MongoDB"
Copy the code

3.4. Start the service

net start mongodb
Copy the code

Error: Invalid service name

Solutions:

G:\Tool\MongodbTool\mongodb\bin\mongod.exe --dbpath "G:\Tool\MongodbTool\mongodb\data" --logpath "G:\Tool\MongodbTool\mongodb\logs\data.log" --install --serviceName "mongo" --logappend --directoryperdb
Copy the code

successful

3.5. Enter the url in the browserhttp://127.0.0.1:27017Is successfully started if the following information is displayed

3.6. Start mongodb, operate the database, and run net stop mongodb exit command

mongo
Copy the code

Iv. Visualization toolsRobo 3T, refer to the official website to download the address

4.1. After downloading, open the application and create a connection (File –> Connect or shortcut CTRL + N)

4.2. Click Create connection, change name localhost, use default address localhost and port 27017, and click Save to save. As shown below:

4.3 After successful connection, you can add database, data table, etc

Write to oneself essay, have a question welcome to point out