CentOS7下mongoc安装,验证

本文详细介绍了在CentOS7上安装MongoDB驱动的过程,包括下载解压、配置、编译安装,以及创建MongoDB数据目录和验证程序的编写与运行。通过这些步骤,确保MongoDB驱动在系统中正确运行。
摘要由CSDN通过智能技术生成

简介

mongoc是MongoDB的C语言驱动

下载解压并配置

$ wget https://github.com/MongoDB/mongo-c-driver/releases/download/1.6.3/mongo-c-driver-1.6.3.tar.gz

$ tar xzf mongo-c-driver-1.6.3.tar.gz

$ cd mongo-c-driver-1.6.3

$ ./configure --disable-automatic-init-and-cleanup                              

如果配置成功会显示如下:

libmongoc 1.6.3 was configured with the following options:
Build configuration:
Enable debugging (slow) : no
Compile with debug symbols(slow) : no
Enable GCC buildoptimization : yes
Enable automatic init andcleanup : no
Enable maintainer flags : no
Code coverage support : no
Cross Compiling : no
Fast counters : no
Shared memory performancecounters : yes
SASL :no
SSL :no
Libbson : bundled
Documentation:
man :no
HTML :no

编译安装mongodb驱动

$make //编译

$sudo make install //安装命令

安装完成可以在

/usr/local/include    目录看到相应的.h文件

/usr/local/lib        目录看到相应的*.so*等文件

安装mongodb

$curl -O https://fastdl.mongodb.org/linux/mongodb-linux-x86_64-3.0.6.tgz    # 下载
$tar -zxvf mongodb-linux-x86_64-3.0.6.tgz                                   # 解压
$mv  mongodb-linux-x86_64-3.0.6/ /usr/local/mongodb                         # 将解压包拷贝到指定目录

创建数据库目录,启动服务

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值