Ubuntu 下安装MongoDB
Jun 07, 2016 pm 05:13 PMUbuntu下安装MongoDB,如果是桌面环境,在控制台中切换到root用户,由于Ubuntu桌面版本中默认的用户没有最高级的权限,所以在控制
MongoDB是一个可伸缩的,高性能的开源NoSQL 文档数据库。主要用C++开发完成。面向文档存储,全索引支持,可复制和高可用性,自动分片等特征。其在非关系型数据库中是功能最丰富,最像关系型数据库的文档数据库。数据结构松散,是类似json的bjson格式。
Ubuntu下安装MongoDB,如果是桌面环境,在控制台中切换到root用户,由于Ubuntu桌面版本中默认的用户没有最高级的权限,所以在控制台中要切换到root。
具体方法:
在Ubuntu桌面环境中,点击 ctrl + alt + t 打开控制台,输入命令: sudo passwd root, 回车后会提示"输入新的unix密码",输入密码用来新生成一个root密码,接下来重新输入确认。然后再命令行中输入su 命令回车,,把刚才设置的密码输入回车。类似下图:
配置包管理系统:
1. Ubuntu 包管理工具确保所下载包的一致性和可靠性。控制台中执行以下命令来导入10gen public GPG Key:
2. 执行命令 vi /etc/apt/sources.list.d/10gen.list
在插入状态输入 下边内容以获得10gen目标库
3. 执行下边命令获得最新库内容
安装MongoDB包
完成安装!
配置MongoDB
配置文件在 /etc/目录,执行命令 vi /etc/mongodb.conf
运行用mongodb用户,MongoDB数据库文件在 /var/lib/mongodb ,数据库日志文件在 /var/log/mongodb
运行MongoDB
停止MongoDB
重启MongoDb
更多Ubuntu相关信息见Ubuntu 专题页面 ?tid=2

Hot Article

Hot tools Tags

Hot Article

Hot Article Tags

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

What should I do if the Ubuntu terminal cannot be opened? How to fix the problem that Ubuntu cannot open the terminal

How to cancel the lock icon in the lower right corner of the Ubuntu 18.04 folder?

A sneak peek of the seven highlights of Ubuntu 24.04 LTS

How to remove icons in Ubuntu start menu?

Ubuntu 20.04 screen recording software OBS installation and uninstallation graphic tutorial

Ubuntu finally supports disabling automatic updates of snap packages

How to install Angular on Ubuntu 24.04
