无法打开mongo连接

时间:2020-11-09 00:49:12

标签: database windows mongodb repair

我正在使用Windows,以前从未遇到过mongo问题,但是现在突然之间我无法打开连接。

首先,我想说的是,过去2个小时我一直在努力解决此问题。我已经尝试过在堆栈溢出时能够在此问题上找到的所有内容,但到目前为止没有任何效果。

当我在终端中运行 const email = document.getElementById("email").value; let error = ""; const emailPattern =/\w+@\w+\.\w+/; password1=document.querySelector('#pass').value; password2=document.querySelector('#pass2').value; if(email.match(emailPattern)) { console.log("vaild"); return true; } else if(email === "") { error = "You entered a blank email address. \n"; alert(error); return false; } else if(email != email.match(emailPattern)) { error = "You have entered an invalid email address!"; alert(error); return false; } if(password1.match(password2)) { console.log("vaild"); return true; } else if(password1 != password2) { error= "The passwords do not match"; alert(error); return false; } else if(password1 && password2 === "") { error = "You entered a blank password"; alert(error); return false; } } 时,我会明白这一点(为简洁起见,仅显示消息的下半部分)

mongod

我已经尝试过的东西。

我尝试运行{"t":{"$date":"2020-11-08T19:33:50.769-05:00"},"s":"I", "c":"STORAGE", "id":4795902, "ctx":"initandlisten","msg":"Closing WiredTiger","attr":{"closeConfig":"leak_memory=true,"}} {"t":{"$date":"2020-11-08T19:33:50.776-05:00"},"s":"I", "c":"STORAGE", "id":4795901, "ctx":"initandlisten","msg":"WiredTiger closed","attr":{"durationMillis":7}} {"t":{"$date":"2020-11-08T19:33:50.776-05:00"},"s":"I", "c":"STORAGE", "id":22281, "ctx":"initandlisten","msg":"shutdown: removing fs lock..."} {"t":{"$date":"2020-11-08T19:33:50.777-05:00"},"s":"I", "c":"-", "id":4784931, "ctx":"initandlisten","msg":"Dropping the scope cache for shutdown"} {"t":{"$date":"2020-11-08T19:33:50.777-05:00"},"s":"I", "c":"CONTROL", "id":20565, "ctx":"initandlisten","msg":"Now exiting"} {"t":{"$date":"2020-11-08T19:33:50.777-05:00"},"s":"I", "c":"CONTROL", "id":23138, "ctx":"initandlisten","msg":"Shutting down","attr":{"exitCode":62}} ,但没有用。

我尝试卸载并重新安装mongo。新安装的版本是更高的版本4.4.1。我认为以前的版本是3.6。

此处的一则帖子说删除数据文件夹并替换它。 我删除了该文件夹及其中的所有内容,并创建了一个新的数据文件夹,但是新的数据文件夹完全为空,我不确定这是否有问题。

这样做以来,我已经运行mongod --repair

这是数据文件夹的位置。 C:\ Program Files \ MongoDB \ Server \ 4.4 \ data

感谢您的帮助,谢谢!

1 个答案:

答案 0 :(得分:0)

请在Windows服务中检查其是否正在运行。 如果没有,请手动启动。

enter image description here