背景:
实际生产中,我们往往只需要mongodb client连接分配给我们的特定数据库,这种情况下,不需要安装mongodb全部,只需要安装mongodb client即可。
另外一种情况,在官方或者网上查到的yum安装方式,我在实践中一直都是报“no package mongodb-core”,只好选择源文件方式安装mongodb。
centos7安装mongodb client
环境信息
环境:CentOS Linux release 7.5.1804 (Core)
版本:client 4.0
安装方式:源文件
安装
1. 使用命令安装:
rpm -ivh mongodb-org-shell-4.0.4-1.el7.x86_64.rpm
2. 安装后mongo文件所在位置: /bin/mongo
centos6安装mongodb
环境信息
环境:CentOS release 6.10 (Final)
版本:
安装方式:源文件
下载地址:
https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-rhel62-4.0.2.tgz
安装
1. 解压:
tar -zxvf mongodb-linux-x86_64-rhel62-4.0.2.tgz
2. 移动到你自己希望存放的目录:
mv mongodb-linux-x86_64-rhel62-4.0.2 /usr/local/share/applications/mongodb_4.0.42
3. 添加到环境变量
vim /etc/profile
添加如下语句:
export PATH=/usr/local/share/applications/mongodb_4.0.42/bin:$PATH
保存后退出
4. 使用配置生效
source /etc/profile
188



被折叠的 条评论
为什么被折叠?



