在C:\Program Files\MongoDB\Server\3.4\bin输入mongo命令报错
mongo报错:[main] Error: couldn't connect to server 127.0.0.1:27017, connection attempt failed
接下来换成mongod, 发现
mongo报错:[main] Error: couldn't connect to server 127.0.0.1:27017, connection attempt failed
原因是找不到相关的文件夹,
解决方案,在相关文件夹下面建立文件夹
(1)在c盘创建data文件夹
mongo报错:[main] Error: couldn't connect to server 127.0.0.1:27017, connection attempt failed
(2)在data文件夹里创建db文件夹
mongo报错:[main] Error: couldn't connect to server 127.0.0.1:27017, connection attempt failed
之后,mongod就启动成功了
mongo报错:[main] Error: couldn't connect to server 127.0.0.1:27017, connection attempt failed
因为我的MongoDB是在c盘安装的,所以只需要在c盘创建文件夹,如果您的MongoDB在其他文件夹,就在相应的盘符创建没有找到的文件夹即可!

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-01-24
  • 2022-01-08
  • 2021-04-04
  • 2021-12-02
  • 2022-12-23
猜你喜欢
  • 2021-10-19
  • 2021-05-31
  • 2021-04-12
  • 2021-12-20
  • 2021-04-03
  • 2022-01-10
相关资源
相似解决方案