MongoDB Manually config
<h1 id="mongodb-manually-config">MongoDB Manually config</h1><blockquote>
<p>macOS 10.15.x</p>
</blockquote>
<h2 id="path-error">path error</h2>
<pre><code class="language-code">exception in initAndListen: NonExistentPath: Data directory /data/db not found.
Create the missing directory or specify another path using (1) the --dbpath command line option,
or (2) by adding the 'storage.dbPath' option in the configuration file.,
terminating 2020-07-16
</code></pre>
<p><img src="https://img2020.cnblogs.com/blog/740516/202007/740516-20200716020344814-310463329.png" alt="" loading="lazy"></p>
<blockquote>
<p>--dbpath</p>
</blockquote>
<p><img src="https://img2020.cnblogs.com/blog/740516/202007/740516-20200716013708699-871325692.png" alt="" loading="lazy"></p>
<h2 id="no-default-config-file-exists">no default config file exists???</h2>
<p><img src="https://img2020.cnblogs.com/blog/740516/202007/740516-20200716014041358-146918101.png" alt="" loading="lazy"></p>
<p>https://github.com/docker-library/mongo/issues/136#issuecomment-274934620</p>
<pre><code class="language-sh"># 手动指定
$ mongod --config /path/to/some/file.conf
# OR
$ mongod -f /path/to/some/file.conf
</code></pre>
<p>https://docs.mongodb.com/manual/reference/configuration-options/#configuration-file</p>
<blockquote>
<p>configuration-file</p>
</blockquote>
<p>https://docs.mongodb.com/manual/reference/configuration-file-settings-command-line-options-mapping/</p>
<p>https://docs.mongodb.com/manual/administration/configuration/</p>
<p><img src="https://img2020.cnblogs.com/blog/740516/202007/740516-20200716014323709-1403731704.png" alt="" loading="lazy"></p>
<blockquote>
<p>error ???</p>
</blockquote>
<pre><code class="language-sh">$ mongod -f /usr/local/etc/mongod.conf
$ mongos -f /usr/local/etc/mongod.conf
</code></pre>
<hr>
<h1 id="solution">solution</h1>
<p><img src="https://img2020.cnblogs.com/blog/740516/202007/740516-20200716020001068-1065118439.png" alt="" loading="lazy"></p>
<p><img src="https://img2020.cnblogs.com/blog/740516/202007/740516-20200716020041874-1815090907.png" alt="" loading="lazy"></p>
<p><img src="https://img2020.cnblogs.com/blog/740516/202007/740516-20200716020208986-847975198.png" alt="" loading="lazy"></p>
<pre><code class="language-sh"># write 权限
$ sudo chown -R `id -un` /System/Volumes/Data/data/db
</code></pre>
<pre><code class="language-sh"># server
$ mongod --dbpath /System/Volumes/Data/data/db
</code></pre>
<pre><code class="language-sh"># client
$ mongo
> show databases;
> quit();
</code></pre>
<h2 id="mongodb-gui">MongoDB GUI</h2>
<blockquote>
<p>Robo 3T</p>
</blockquote>
<p>https://robomongo.org/download</p>
<h2 id="refs">refs</h2>
<blockquote>
<p>MongoDB & macOS (install manually)</p>
</blockquote>
<p>https://www.cnblogs.com/xgqfrms/p/9770091.html</p>
<hr>
<div>
</div>
<hr>
<blockquote style="display: flex; flex-flow: column; align-items: center; justify-content: center; text-align: center; border: none">
<h3><strong><span style="font-size: 16pt; color: rgba(0, 255, 0, 1)">©xgqfrms 2012-<span data-uid="copyright-aside">2020</span></span></strong>
<p><span style="font-size: 18pt; color: rgba(0, 255, 0, 1)"><strong>www.cnblogs.com 发布文章使用:只允许注册用户才可以访问!</strong></span></p>
</h3></blockquote>
<hr>
</div>
<div id="MySignature" role="contentinfo">
<div style="display: flex; flex-flow: column nowrap; align-items: center; justify-content: center;">
<p>本文首发于博客园,作者:xgqfrms,原文链接:https://www.cnblogs.com/xgqfrms/p/13313153.html</p>
<p style="color: red; font-size: 23px; margin-top: 5px; margin-botom: 5px;">未经授权禁止转载,违者必究!</P>
</div>
<hr/><br><br>
来源:https://www.cnblogs.com/xgqfrms/p/13313153.html
頁:
[1]