记一次连接 MongoDB Compass Community 报错的小坑

MongoDB Compass Community 是mongodb官方提供的可视化工具,有一次使用的时候总是报
MongoDB not running on the provided host and port的错误。

如下:
记一次连接 MongoDB Compass Community 报错的小坑
可是我的mongodb服务明明运行起来了。并且也能在浏览器中运行

记一次连接 MongoDB Compass Community 报错的小坑
后来折腾之后才发现原来是自己工作的时候,吧本地代理修改了
记一次连接 MongoDB Compass Community 报错的小坑
小坑,应该吧本地host改回这样

记一次连接 MongoDB Compass Community 报错的小坑
有的时候连接不上还有可能是因为上帝在命令行退出mongodb的时候不规范埋下的坑。
这个时候吧 /data/db/mongod.lock 这个文件删除掉,然后重启mongoddb 的服务就好。