当前位置:网站首页>MongoDB的下载、安装和使用
MongoDB的下载、安装和使用
2022-07-17 05:25:00 【guizi0809】
一、下载
MongoDB 官网 https://www.mongodb.com/zh-cn
以社区版本为例
选择下载的版本和系统,当前选择版本为5.0.3,windows系统,下载文件格式为msi
二、安装
除了下面两项需要设置外,都点Next进入下一步
1.选择Complete,表示安装到默认路径(不推荐,C盘懂的都懂) 选择Custom,表示自定义安装路径(推荐),这里演示用就都安装在C盘了
2.设置MongoDB的服务名称,数据目录和日志目录,建议将数据目录和日志目录设置在其他盘,因为c盘一般是系统盘,重装系统会丢失。
安装中…
安装完成~
三、配置
打开cmd,输入mongo命令
找到MongoDB安装目录的bin文件夹
复制这个bin文件夹目录路径
“我的电脑”右键–>属性,如下图打开系统变量配置
将刚刚复制的bin目录路径添加在系统环境变量中
重新打开cmd命令窗口,输入mongo命令
四、使用
#关于命令中的参数说明
#参数 描述
#--bind_ip 绑定服务IP,若绑定127.0.0.1,则只能本机访问,不指定默认本地
#所有IP
#--logpath 定MongoDB日志文件,注意是指定文件不是目录
#--logappend 使用追加的方式写日志
#--dbpath 指定数据库路径
#--port 指定服务端口号,默认端口27017
#--serviceName 指定服务名称
#--serviceDisplayName 指定服务名称,有多个mongodb服务时执行。
#--install 指定作为一个Windows服务安装。
启动MongoDB服务端

在浏览器访问 http://localhost:27017。见到如下页面,说明启动成功
打开一个新的cmd窗口,使用mongo命令启动MongoDB客户端 (注意:上面开启的MongoDB服务端不能关闭)
比如连接本地数据库
mongo
#或
mongo 127.0.0.1:27017
远程数据库
mongo 远程ip地址:27017
在MongoDB客户端输入show dbs查看数据库
MongoDB的使用
边栏推荐
- Practical tutorial: application of canoe in CAN bus test
- 泰坦尼克号乘客获救预测(进阶)
- Fundamentals of reptiles - basic principles of reptiles
- 利用PCA来简化数据
- TSN security protocol (802.1qci)
- Notepad++ underline and case letter replacement
- Network knowledge-03 data link layer Ethernet
- Basic lighting knowledge of shader introduction
- 实操教程:CANoe在CAN总线测试中的应用
- Review of Linear Algebra
猜你喜欢

Jenkins 忘记密码怎么办?

nodejs

Summary of Statistics for Interview

Install SQL developer for Galaxy Kirin desktop operating system v10sp1 (x86)

Spark introduction to proficient - external part (operation and maintenance and simple operation of standaone cluster)

Network knowledge-03 data link layer Ethernet

Network knowledge-04 network layer ICMP Protocol

小怿和你聊聊V2X测试系列之 如何实现C-V2X HIL测试(2022版)

深度学习笔记 Coursera Deep learning Notes

Development board training: multi task program under stm32
随机推荐
What is the difference between SD NAND and nandflash?
【量化笔记】波动volatility相关技术指标以其含义
SQL刷题总结 SQL Leetcode Review
Coursera deep learning notes
Typescript (TS loader, tsconfig.json and lodash)
一文带你了解SOA接口测试
Jenkins 忘记密码怎么办?
Spark3.x-实战之mysql方式实现kafka精准一次性消费
Tail -f pause method
预测销售XGBoost
Spark3.x-实战之双流join(窗口和redis实现方式和模板代码)
Review of 4121 Computer System for Data Science
nodejs
持续集成如何进行Jenkins管理?
Network knowledge-03 data link layer Ethernet
HMI概念设计的未来在哪里?
fiddler 抓包工具使用
Canel Introduction & use
网络知识-03 数据链路层-PPP
Download, configuration and basic use of C language compiler