title: How to specify the path to config file in mongodb
body: <p>In config file I have:</p>
  
  <pre><code>systemLog:
      destination: file
      logAppend: true
      path: c:\data\log\mongod.log
  storage:
      dbPath: c:\data\db
      journal:
          enabled: true
  replication:
     replSetName: "rs0"
  net:
     bindIp: 127.0.0.1
     port: 27017
  security:
       authorization: enabled
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/xJFBT.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/xJFBT.png" alt="enter image description here"></a></p>
  
  <p>I'm trying to connect using <code>mongod</code> process like in <a href="https://docs.mongodb.com/manual/reference/configuration-options/#use-the-configuration-file" rel="nofollow noreferrer">documentation</a>:</p>
  
  <pre><code>C:\Program Files\MongoDB\Server\3.6\bin&gt; mongod --auth --dbpath /data/db --config C:\Program Files\MongoDB\Server\3.6\mongod.cfg
  </code></pre>
  
  <p>And getting: </p>
  
  <blockquote>
    <p>Error reading config file: No such file or directory<br>
    try 'C:\Program Files\MongoDB\Server\3.6\bin\mongod.exe --help' for more information</p>
  </blockquote>
  
  <p><a href="https://i.stack.imgur.com/JGR2j.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/JGR2j.png" alt="enter image description here"></a></p>
  
  <p>Then trying with quotes </p>
  
  <pre><code>C:\Program Files\MongoDB\Server\3.6\bin&gt; mongod --auth --dbpath /data/db --config "C:\Program Files\MongoDB\Server\3.6\mongod.cfg"
  </code></pre>
  
  <p>and getting:</p>
  
  <blockquote>
    <p>2018-07-02T02:49:21.272+0300 I CONTROL  [main] log file "c:\data\log\mongod.log" exists; moved to "c:\data\log\mongod.log.2018-07-01T23-49-21".</p>
  </blockquote>
  
  <p><a href="https://i.stack.imgur.com/PePhn.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/PePhn.png" alt="enter image description here"></a>
  Starting <code>mongo</code>, then <code>show dbs</code> and see: <a href="https://i.stack.imgur.com/6OVrv.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/6OVrv.png" alt="enter image description here"></a></p>
  
  <p>If I'm writting this snippet (without config), everything is fine: </p>
  
  <pre><code>mongod --auth --dbpath /data/db --bind_ip 127.0.0.1
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/333mJ.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/333mJ.png" alt="enter image description here"></a>
  With <code>mongo</code>: 
  <a href="https://i.stack.imgur.com/H0KNE.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/H0KNE.png" alt="enter image description here"></a>
  What I'm doing wrong? I appreciate any help.</p>