当前位置:网站首页>下载并安装MongoDB
下载并安装MongoDB
2022-04-23 15:57:00 【aserendipper】
一、下载MongoDB
1、打开MongoDB官网下载主页https://www.mongodb.com/try/download,找到community社区版,然后选择对应的版本下载。
Version版本,选择带有current字眼的,这是最新的稳定版本
OS是系统,这里选择RHEL 7.0 ,对应的Centos就是7.x
Package 是包的格式,这里选择TGZ,是压缩包
二、安装MongoDB
1、上传压缩包到/usr/local目录下并解压
tar -zxvf mongodb-linux-x86_64-rhel70-4.2.8.tgz
2、重命名文件夹为mongodb
mv mongodb-linux-x86_64-rhel70-4.2.8/ mongodb/
3、进入mongodb文件夹下,创建数据和日志存放的文件夹
mkdir data #用来存放mongodb的数据库数据
mkdir logs #用来存放mongodb运行产生的日志
4、创建配置文件
vim mongodb.conf
#日志文件位置
logpath=/usr/local/mongodb/logs/mongodb.log
#以追加方式写入日志
logappend=true
#是否以守护进程方式运行
fork=true
#端口27017
port=27017
#数据库文件位置
dbpath=/software/mongodb/data
#允许哪个ip的连接,0.0.0.0表示任一ip都可以连接
bind_ip=0.0.0.0
#是否以安全认证方式运行,默认是不认证的非安全方式,一开始安装启动不需要开启,设置好密码后再重启
#auth=true
此时的目录结构为:
5、启动mongodb
bin/mongod --config mongodb.conf
启动成功后:
6、连接mongodb并测试
进入bin目录下,执行
./mongo
show dbs
可以看到有默认的三个数据库
三、参考资料
1、https://blog.csdn.net/americaMan/article/details/105755863
版权声明
本文为[aserendipper]所创,转载请带上原文链接,感谢
https://blog.csdn.net/qq_39234967/article/details/109444803
边栏推荐
- JVM - Chapter 2 - class loader subsystem
- 捡起MATLAB的第(4)天
- Partitionby of spark operator
- vim指定行注释和解注释
- Upgrade MySQL 5.1 to 5.69
- mysql乐观锁解决并发冲突
- dlopen/dlsym/dlclose的简单用法
- 一文掌握vscode远程gdb调试
- [AI weekly] NVIDIA designs chips with AI; The imperfect transformer needs to overcome the theoretical defect of self attention
- R语言中实现作图对象排列的函数总结
猜你喜欢
Codejock Suite Pro v20. three
Do we media make money now? After reading this article, you will understand
贫困的无网地区怎么有钱建设网络?
The principle and common methods of multithreading and the difference between thread and runnable
Grbl learning (I)
TIA博图——基本操作
GRBL学习(一)
MetaLife与ESTV建立战略合作伙伴关系并任命其首席执行官Eric Yoon为顾问
Configuration of multi spanning tree MSTP
多生成树MSTP的配置
随机推荐
Partitionby of spark operator
API IX JWT auth plug-in has an error. Risk announcement of information disclosure in response (cve-2022-29266)
【现代电子装联期末复习要点】
Import address table analysis (calculated according to the library file name: number of imported functions, function serial number and function name)
JS regular determines whether the port path of the domain name or IP is correct
MetaLife与ESTV建立战略合作伙伴关系并任命其首席执行官Eric Yoon为顾问
Neodynamic Barcode Professional for WPF V11. 0
Timing model: gated cyclic unit network (Gru)
Spark 算子之sortBy使用
幂等性的处理
Go language, condition, loop, function
Redis主从复制过程
js正則判斷域名或者IP的端口路徑是否正確
【开源工具分享】单片机调试助手(示波/改值/日志) - LinkScope
mysql乐观锁解决并发冲突
Treatment of idempotency
Accumulation of applet knowledge points
贫困的无网地区怎么有钱建设网络?
Modèle de Cluster MySQL et scénario d'application
多生成树MSTP的配置