Mongodb: Failed to connect to 127.0.0.1:27017, reason: errno:10061

后端 未结 17 2230
醉话见心
醉话见心 2020-11-29 19:12

Here is my mongod.cfg file:

bind_ip = 127.0.0.1
dbpath = C:\\mongodb\\data\\db
logpath = C:\\mongodb\\log\\mongo-server.log
verbose=v

17条回答
  •  半阙折子戏
    2020-11-29 19:49

    When This Error is Coming it is lack of the following

    1)Setting the path to mongo db go to "C" Drive and the installation of Mongo db directory and then go to bin folder in the mongo and copy the path of it

    c:/mongodb/server/3.2/bin/ and create a new environmental variable in system properties then name is path and value="c:/mongodb/server/3.2/bin/" here my version is 3.2

    2)create a data directory for the data in C Drive c:/Data/twitter

    3)start the server with **

    c:/> mongod

    check your port config if there is any error as the local port may be assigned to any other 4)start your Mongo database with

    Mongo then your mongo db will start

    then in your mongo database create a database

    use DATABASE_NAME

    for example:

    use twitterdata

    switched to db twitterdata

    to check your current database

    db

    twitterdata

    to get total databases

    show dbs

提交回复
热议问题