Cannot access mongodb through browser - It looks like you are trying to access MongoDB over HTTP on the native driver port

前端 未结 5 1975
我在风中等你
我在风中等你 2021-01-30 11:09

I open terminal and enter the following commands

sudo mongod

which then outputs

[initandlisten] waiting for connections on port         


        
5条回答
  •  南笙
    南笙 (楼主)
    2021-01-30 11:52

    I am in ubuntu 14.04 and mongod is registered as an upstart service. The answers in this post sent me in the right direction. The only adaptation I had to do to make things work with the upstart service was to edit /etc/mongod.conf. Look for the lines that read:

    # Enable the HTTP interface (Defaults to port 28017).
    # httpinterface = true
    

    Just remove the # in front of httpinterface and restart the mongod service:

    sudo restart mongod
    

    Note: You can also enable the rest interface by adding a line that reads rest=true right below the httpinterface line mentioned above.

提交回复
热议问题