Failed Global Initialization: BadValue logpath requires an absolute file path with windows services

前端 未结 10 1523
庸人自扰
庸人自扰 2021-02-19 07:25

I am getting this error constantly while i am trying to install mongod using a configuration file. So, I am looking at this tutorial on Pluralsight on mongodb. The person\'s pro

10条回答
  •  悲&欢浪女
    2021-02-19 08:28

    I ran into the same problem. But I could resolve it by updating the paths as follows. I could see the problem is with Forward and backward slashes in file paths.

    mongod.conf (instead of giving the relative path provide absolute path and also make sure you have "/" instead of "\")

    dbpath= C:/mongolearning/db
    logpath= C:/mongolearning/mongo-server.log
    verbose=vvvvv
    

    and then go to Command prompt:

    C:\Program Files\MongoDB\Server\3.2\bin>mongod -f "C:\Program Files\MongoDB\Server\3.2\bin\mogod.conf" --install
    

    and then

    C:\Program Files\MongoDB\Server\3.2\bin>net start mongodb
    

    Boom it started.

    The MongoDB service is starting. The MongoDB service was started successfully.

提交回复
热议问题