在安装MongoDB的时候,下载了3.6版本,安装过程中发现到一半就卡死了,后面换了一个较低版本的才安装成功

这里是所有MongoDB版本的下载地址:

https://www.mongodb.org/dl/win32/x86_64-2008plus-ssl?_ga=2.115265476.272239361.1515997841-1827559456.1515997841

下载后安装,一路next安装完成,next、custom,改变安装位置。

把MongoDB安装在C盘目录下,安装完成后,创建数据库文件(自己创建data和db文件夹)的存放位置,比如

C:\MongoDB\data\db

然后打开终端,来到bin目录下,输入

mongod --dbpath C:\MongoDB\data\db

打开 http://127.0.0.1:27017/ ,发现如下提示:

It looks like you are trying to access MongoDB over HTTP on the native driver port.

将MongoDB服务器作为Windows服务运行

重新打开一个cmd终端(一定要管理员身份C:\Windows\System32\cmd.exe,右键以管理员身份运行,这个超级重要),继续来到并目录下,输入

mongod --dbpath "C:\MongoDB\data\db" --logpath "C:\MongoDB\data\log\mongo.log" --install --serviceName "MongoDB"

 输入上述命令之后出现了一些错误
Failed global initialization:FileNotOpen: Failed to open "C:\MongoDB\data\log\mongo.log"  

研究后发现是没有创建这些文件,手动创建这些文件后重新打开cmd命令行,进入到bin里面,继续输入上面命令即可。

开启服务

接下来用命令net start mongodb 用来开启服务

打开任务管理器,服务,找到MongoDB,发现MongoDB正在运行。

好了,填坑就到这里,下面继续学习吧。


Failed global initialization:FileNotOpen: Failed to open "C:\MongoDB\data\log\mongo.log" 安装MongoDB时卡死的更多相关文章

  1. org.springframework.beans.factory.BeanCreationException,Invocation of init method failed,Context initialization failed

    G:\javaanzhuang\apache-tomcat-\bin\catalina.bat run [-- ::,] Artifact ssm_qingmu02_web:war exploded: ...

  2. 单点登录(十)-----遇到问题-----cas启用mongodb验证方式报错com.mongodb.CommandFailureException---Authentication failed

    cas启用mongodb验证方式报错com.mongodb.CommandFailureException---Authentication failed. 完整报错信息: 二月 08, 2017 5 ...

  3. log4j:ERROR Failed to rename [/log/xxx.log] to [/log/xxx.log.2016-11-23.log]

    Log4j报错: log4j:ERROR Failed to rename [/log/xxx.log] to [/log/xxx.log.2016-11-23.log] google了一下发现是个b ...

  4. Maven-008-Nexus 私服部署发布报错 Failed to deploy artifacts: Failed to transfer file: ... Return code is: 4XX, ReasonPhrase: ... 解决方案

    我在部署构件至 maven nexus 私服时,有时会出现 Failed to deploy artifacts: Failed to transfer file: ... Return code i ...

  5. postman Installation has failed: There was an error while installing the application. Check the setup log for more information and contact the author

    Error msg: Installation has failed: There was an error while installing the application. Check the s ...

  6. FTP:500 OOPS: failed to open vsftpd log file:/var/log/vsftpd.log

    如下:从10.12.8.165 FTP 到 10.1.3.34,报failed to open vsftpd log[a4_csbdc@localhost ~]$ ftp  10.1.3.34Conn ...

  7. centos 7 系统启动不了 出现报错dependency failed for /mnt , dependency failed for local file systems

    阿里云一台Ecs重启后启动不了,出现报错 dependency failed for /mnt , dependency failed for local file systems ,  报错的原因  ...

  8. 运行Virtualbox去安装系统时出错:Failed to open a session for the virtual machine,Unable to load R3 module xxxx/VBoxDD.DLL(VBoxDD)

    貌似看到不少人(1,2,3),在使用Virtualbox去安装系统时,都遇到这个错误: 比如这里遇到的: 截图: 和另外这里的截图: 加文字描述: Failed to open a session f ...

  9. maven打包出错: Failed to clean project: Failed to delete

    maven打包出错: Failed to clean project: Failed to delete 出现这种错误,通常是由于您已启动了另一个tomcat 进程,导致报错,关闭tomcat进程即可 ...

随机推荐

  1. Day 3 下午

    依旧是组合数问题 先来看一道题 如图,一个n*m的方格中,从原点开始,每次只能向上走或者向右走,求走到点(n,m)共有多少种走法 一般做法: 一个一个写,每一个节点的种数=它左边的数量+右边的数量 显 ...

  2. D. Maximum Diameter Graph 贪心+图论+模拟

    题意:给出n个点的度数列 上限(实际点可以小于该度数列)问可以构造简单路最大长度是多少(n个点要连通 不能有平行边.重边) 思路:直接构造一条长链  先把度数为1的点 和度数大于1的点分开  先把度数 ...

  3. php中fastcgi和php-fpm是什么东西

    参考和学习了以下文章: 1. mod_php和mod_fastcgi和php-fpm的介绍,对比,和性能数据 2. 实战Nginx_取代 为了如何一步步的引出fastcgi和php-fpm,我先一点一 ...

  4. Windows下Redis的安装和部署

    Redis 简介 Redis 是完全开源免费的,遵守BSD协议,是一个高性能的key-value数据库. Redis 与其他 key - value 缓存产品有以下三个特点: Redis支持数据的持久 ...

  5. 洛谷P1258 小车问题(题解)

    https://www.luogu.org/problemnew/show/P1258(题目传送) 看题的第一眼就把题归为二分题,一直向着二分的方向走,却忽略了数学的推理.推理一番后(看了题解),发现 ...

  6. 什么是javabean及其用法(转)

    因工作需要 需要学习jsp方面的知识 这篇博客文章写得比较全面 我记录下: 一.什么是JavaBean JavaBean是一个遵循特定写法的Java类,它通常具有如下特点: 这个Java类必须具有一个 ...

  7. 主机管理+堡垒机系统开发:strace工具的实现原理(七)

    strace是Linux系统下的一个用来跟踪系统调用的工具,它的实现基础是ptrace系统调用.使用strace工具可以跟踪一个程序执行过程中发生的系统调用. 我这里讲到的内容有一点点和mips体系相 ...

  8. Java进程线程笔记

    什么是并行和并发? 并发和并行是即相似又有区别:(微观) 并行:指两个或多个事件在同一时刻发生: 强调的是时间点. 并发:指两个或多个事件在同一时间段内发生: 强调的是时间段. 进程和线程的区别? 进 ...

  9. Regularity criteria for NSE 5: $u_3,\om_3$

    In [Zhang, Zujin. Serrin-type regularity criterion for the Navier-Stokes equations involving one vel ...

  10. Jenkins 子业务日志拆分分析方法

    需求 Jenkins日志打印内容很长,或者并发编译导致,日志内容不容易查看. 对于具体业务失败, 开发者希望看到具体业务自身的日志内容. 解法 tee 命令能够保证, shell命令执行的内容,即往控 ...