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

Java manipulates MongoDB_1 (environment settings)

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

Share

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

Environment configuration

1. First download the Jar package of MongoDB. My version here is mongo-2.10.1.jar.

two。 Configure the environment for mongodb

1) copy the environment of mongodb to the specified folder, and here I copy it to the D:\ mongodb directory

2) start the server program of mongodb, open the DOS window, set the path to the D:\ mongodb directory, and run the mongod.exe command directly

3) start the client program of mongodb. Open the DOS window, set the path to the D:\ mongodb directory, and run mongo.exe directly

Note: if running mongod.exe fails, it is possible that the default storage path for local database files has not been created, just create a data/db folder on disk D. Or when starting mongod.exe, set-- path.

Or the file D:\ data\ db\ mongod.lock may be locked, deleted and restarted directly.

3. Create a new Java project for MongoDBTest. The IDE I use is MyEclipse. After creation, add the mongo-2.10.1.jar package to the project

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

Wechat

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

12
Report