Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Mongodb install for windows7 64-bit

2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

Configure the Mongo server

1. On the official website: http://www.mongodb.org/ downloads the latest mongodb according to the operating system.

Download version: mongodb-win32-x86_64-2008plus-ssl-3.0.4-signed.msi.

two。 Create a new MongoDB folder on disk D (install the version 1 customization to the directory D:\ MongoDB).

3. Create a new logs folder within the MongoDB folder (used to store the log file D:\ MongoDB\ logs), and create a new empty file mongodb.log within this folder.

4. Create a new db folder within the MongoDB folder (for storing database files D:\ MongoDB\ db).

5. Start MongoDB.

Run cmd as a system administrator, change to the D:\ MongoDB\ bin directory and enter mongod.exe-- dbpath=d:\ mongodb\ db. If you see the last line of the console similar to Tue Oct 09 11:50:55 [websvr] admin web console watiing for connections on port 28017, it means you started successfully (MongoDB occupies port 28017 of the system)

.

6. Test MongoDB

Create a new cmd window as an administrator and enter mongo in the bin directory of MongoDB. If connecting to:test appears, the test passes.

Continue testing:

(1)。 Enter use test to enter enter

(2)。 Enter db.foo.save ({hello:1, baie:2}) to enter

(3)。 Enter db.foo.find () enter

If messages such as {"_ id": ObjectId ("5073a0a090f93be1455461d2"), "hello": 1, "baie": 2} appear, the test success data has been inserted into the database, and then type exit to exit.

7. Register MongoDB to serve the system (this step must run cmd as a system administrator, otherwise an error will be reported)

Run cmd input as a system administrator and change to MongoDB's bin directory to run the following statement

Mongod.exe-dbpath=d:\ mongodb\ db-logpath=d:\ mongodb\ logs\ mongodb.log-install-serviceName "MongoDB"

Enter

If a statement like Tue Oct 09 12:05:15 Service can be started from the command line with 'net start MongoDB' appears on the console, the service has been registered successfully.

8. Enter net start MongoDB in cmd to start the MongoDB database service, and the console output MongoDB service has been started successfully, indicating that the system has started successfully.

9. If there is a system error 1067, please delete the mongod.lock file in the db directory and re-enter net start MongoDB to start the service.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report