当前位置:网站首页>Configure mongodb database in window environment
Configure mongodb database in window environment
2022-07-07 15:19:00 【1024 questions】
Mongodb I've also learned about it these days , Today, the environment is configured , Learn from today Mongodb database .
One 、 downloadChoose the development environment to download from this website https://www.mongodb.com/download-center, And download it . I chose 64 Bit support ssl Of 3.2.7 edition .
Two 、 installDownload the msi Install after file , When installing, you need to pay attention to the installation path , I installed it in G:\MongoDB In the folder of . After installation MongoDB The following files will appear in the folder
3、 ... and 、 Set the data storage location1. Create a new folder to store the database , I'm here G:\MongoDB I created a db Folder
2. Specify the data storage location
From the command line window , Point to G:\MongoDB\bin file , And then through mongod --dbpath=G:\MongoDB\db
Set the location of data storage
We can also see from the screenshot above 27017 Port waiting for connection , open http://localhost:27017/ You can see the following page
Default Mongodb Yes, even test database , So you can connect and test , After connecting, the effect of the following figure will appear , It may be reported when connecting mongodb Can't start , Because the target computer actively refuses , Unable to connect , This is because we need to mongodb start-up , And the designation mentioned above dbpath
5、 ... and 、 take MongoDB Set to Window serviceSpecific reference : by MongoDB Database registration windows service
The previous operation failed , I tried again today, but I didn't expect to succeed . Here are the steps :
1. The above also says to create db and log Two folders to store data and logs . stay log Create under folder mongod.log file
2. Open to bin Execute the following command under file ( You must be an administrator )
mongod -dbpath "G:\MongoDB\db" -logpath "G:\MongoDB\log\mongod.log" -install -serviceName "MongoDB"
Delete service
mongod -dbpath "G:\MongoDB\db" -logpath "G:\MongoDB\log\mongod.log" -remove -serviceName "MongoDB"
The following error appears :
2016-07-17T20:22:36.894+0800 I CONTROL [main] log file "G:\MongoDB\log\mongod.log" exists; moved to "G:\MongoDB\log\mongod.log.2016-07-17T12-22-36".
This can be ignored and then started MongoDB service :
6、 ... and 、 Add or delete the query, which is simple to useOpen another one cmd, Input mongo Command to open shell, Actually this shell Namely mongodb The client of , It's also a js The compiler , The default connection is “test” database .
The database is simply added, deleted, modified and checked , Let's have a simple try first
This is about Window Environment Mongodb That's all for the database article . I hope it will be helpful for your study , I also hope you can support the software development network .
边栏推荐
- Promoted to P8 successfully in the first half of the year, and bought a villa!
- 广州开发区让地理标志产品助力乡村振兴
- 8大模块、40个思维模型,打破思维桎梏,满足你工作不同阶段、场景的思维需求,赶紧收藏慢慢学
- Cocoscreator resource encryption and decryption
- 什么是数据泄露
- Used by Jetson AgX Orin canfd
- Apache multiple component vulnerability disclosure (cve-2022-32533/cve-2022-33980/cve-2021-37839)
- Spatiotemporal deformable convolution for compressed video quality enhancement (STDF)
- [server data recovery] data recovery case of raid failure of a Dell server
- Niuke real problem programming - day15
猜你喜欢
【跟着江科大学Stm32】STM32F103C8T6_PWM控制直流电机_代码
Why do we use UTF-8 encoding?
MongoD管理数据库的方法介绍
Ctfshow, information collection: web2
MySQL bit类型解析
With 8 modules and 40 thinking models, you can break the shackles of thinking and meet the thinking needs of different stages and scenes of your work. Collect it quickly and learn it slowly
【服务器数据恢复】某品牌StorageWorks服务器raid数据恢复案例
Unity's ASE achieves full screen sand blowing effect
Stream learning notes
CTFshow,信息搜集:web6
随机推荐
【服务器数据恢复】戴尔某型号服务器raid故障的数据恢复案例
[target detection] yolov5 Runtong voc2007 data set
【跟着江科大学Stm32】STM32F103C8T6_PWM控制直流电机_代码
写一篇万字长文《CAS自旋锁》送杰伦的新专辑登顶热榜
#HPDC智能基座人才发展峰会随笔
TypeScript 发布 4.8 beta 版本
Runnable是否可以中断
Excerpted words
Protection strategy of server area based on Firewall
避坑:Sql中 in 和not in中有null值的情况说明
[follow Jiangke University STM32] stm32f103c8t6_ PWM controlled DC motor_ code
【目标检测】YOLOv5跑通VOC2007数据集
Ctfshow, information collection: web7
STM32F103C8T6 PWM驱动舵机(SG90)
[make a boat diary] [shapr3d STL format to gcode]
With 8 modules and 40 thinking models, you can break the shackles of thinking and meet the thinking needs of different stages and scenes of your work. Collect it quickly and learn it slowly
Niuke real problem programming - day15
[机缘参悟-40]:方向、规则、选择、努力、公平、认知、能力、行动,读3GPP 6G白皮书的五层感悟
IDA pro逆向工具寻找socket server的IP和port
CTFshow,信息搜集:web1