MongoDB on Linux - Data directory /data/db not foundPublished on 09 Jun 2019 1 min read
So, as a distro-hopper I end up installing MongoDB more often than I’d like to admit. On all times, I’ve stumbled upon an error right when trying to start the
mongod service, after following the official instructions. The important line here is:
exception in initAndListen: NonExistentPath: Data directory /data/db not found., terminating
This seems like an error on Mongo’s install script. The problem is that by default, Mongo points to that
/data/db folder, and it either forgets to create or set ownership of it on installation.
Thankfully, the solution is quite simple. First, we’ll make sure that the folder in question exists. Run the following command from your Terminal:
And then, we’ll set the ownership of the folder to the user that’s going to start the mongod service. Since I only use if for local development in my computer, I set myself as the owner:
Now, just running
mongod should do the job. Hope that helps you!
Thanks for reading!
.NET Core - Project version mismatch1 min read
This problem usually happens when you’re working on a solution with multiple projects that were created using different versions of...Click to read more…
.NET Core API - Method not allowed on PUT and DELETE requests2 min read
Recently, I’ve been working on an Angular app, powered with a .NET Core API. Everything was working well and smoothly...Click to read more…