爬虫学习1: Win32下mongodb报错“"28663 Cannot start server"和"29 Data directory /data/db not found."

本文详细记录了在Win32系统中安装MongoDB的过程,包括解决存储引擎不可用及数据目录未找到等问题,最终成功安装并配置环境变量。

win32的老电脑想学点东西真是麻烦,官网没有32位的支持了。找了两篇博客结合着看,可以装32位的。

https://www.cnblogs.com/chenyucong/p/6217017.html

https://blog.youkuaiyun.com/sunmimmy/article/details/80342444

遇到问题:

按照教程的指导,我在cmd输入了

>>>e:

>>>cd MongDB\bin

>>>mongod -dbpath "e:\MongoDB\data"

结果却和教程不一样报错:

2019-07-30T09:37:21.686+0800 I STORAGE  [initandlisten] exception in initAndList
en: 28663 Cannot start server. The default storage engine 'wiredTiger' is not av
ailable with this build of mongod. Please specify a different storage engine exp
licitly, e.g. --storageEngine=mmapv1., terminating
2019-07-30T09:37:21.687+0800 I CONTROL  [initandlisten] dbexit:  rc: 100

上网查询,说是没有权限什么什么,然后给了一些linux下的命令行,我一个windows当然就不想看。

又找到一篇https://blog.youkuaiyun.com/hotdust/article/details/51348731

按照

mongod --storageEngine=mmapv1 --dbpath [your-path]

输入

mongod --storageEngine=mmapv1 --dbpath "e:\MongoDB\mongdb\data"

又报错

MongoDB exception in initAndListen: 29 Data directory /data/db not found., terminating

可以参考https://blog.youkuaiyun.com/a6864657/article/details/82943111

既然错误信息说是data文件没找到,就去根目录看一下,结果发现是自己没有创建e:\MongoDB\mongodb\data文件

大汗..............赶紧手动创建一个,继续按原思路操作。

成功安装!!!

最后一行:waiting for connections on port 27017,表示配置成功

***************************************************************************************************

配置环境变量,之前没接触真的是摸不着头脑

右键点击“我的电脑”------->“高级系统设置“------->”环境变量“------->”系统变量“--------->点击Path,在变量值后面加上;e:\MongDB\bin

PS:如果这里没配置好,在控制台输入mongod会显示“mongod既不是内部或外部命令”也不是有效的文件夹或目录。

 

mongodb-win32-x86_64-2012plus-4.2.24 MongoDB README Welcome to MongoDB! COMPONENTS mongod - The database server. mongos - Sharding router. mongo - The database shell (uses interactive javascript). UTILITIES install_compass - Installs MongoDB Compass for your platform. BUILDING See docs/building.md. RUNNING For command line options invoke: $ ./mongod --help To run a single server database: $ sudo mkdir -p /data/db $ ./mongod $ $ # The mongo javascript shell connects to localhost and test database by default: $ ./mongo > help INSTALLING COMPASS You can install compass using the install_compass script packaged with MongoDB: $ ./install_compass This will download the appropriate MongoDB Compass package for your platform and install it. DRIVERS Client drivers for most programming languages are available at https://docs.mongodb.com/manual/applications/drivers/. Use the shell ("mongo") for administrative tasks. BUG REPORTS See https://github.com/mongodb/mongo/wiki/Submit-Bug-Reports. PACKAGING Packages are created dynamically by the package.py script located in the buildscripts directory. This will generate RPM and Debian packages. DOCUMENTATION https://docs.mongodb.com/manual/ CLOUD HOSTED MONGODB https://www.mongodb.com/cloud/atlas FORUMS https://community.mongodb.com A forum for technical questions about using MongoDB. https://community.mongodb.com/c/server-dev A forum for technical questions about building and developing MongoDB. LEARN MONGODB https://university.mongodb.com/ LICENSE MongoDB is free and open-source. Versions released prior to October 16, 2018 are published under the AGPL. All versions released after October 16, 2018, including patch fixes for prior versions, are published under the Server Side Public License (SSPL) v1. See individual files for details. 根据这个记事本,你认为我安装了mongodb server吗?
最新发布
08-09
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值