1、在一次开发中,mongodb意外关闭,再次启动时一直报1067错误,如下
The Mongo DB service is starting.
The Mongo DB service could not be started.
A system error has occurred.
System error 1067 has occurred.
The process terminated unexpectedly.
2、百度果然不行,搜到方案,大都是这种,也难怪国内博客抄袭乱象
mongod.exe --config E:\ruanjian\MongoDB\mongod.cfg --remove
mongod.exe --config E:\ruanjian\MongoDB\mongod.cfg --install
3、于是换用谷歌,3秒解决问题,
1) remove the file /data/db/mongod.lock
2) run mongod.exe --repair
3) start the mongod service net start MongoDB
4、3中的文件,根据自己文件的实际路径来处理
5、官方原文
https://mongodb-documentation.readthedocs.io/en/latest/tutorial/recover-data-following-unexpected-shutdown.html