Alex Rivera | Logout

What is the default database path for MongoDB?

Asked 2012-10-05T01:31:51.783
75

I got an error about dbpath (/data/db/) does not exist, but /etc/mongodb.conf named it dbpath = /var/lib/mongodb. So, which is the default dbpath for MongoDB?

Edit
Report

2 Answers

24

I have version 2.0.7 installed on Ubuntu and it defaulted to /var/lib/mongodb/ and that is also what was placed into my /etc/mongodb.conf file.

answered 2012-10-05T01:40:28.707
10

I depends on the version and the distro.

For example the default download pre-2.2 from the MongoDB site uses: /data/db but the Ubuntu install at one point used to use: var/lib/mongodb.

I think these have been standardised now so that 2.2+ will only use data/db whether it comes from direct download on the site or from the repos.

answered 2012-10-05T07:11:52.833

Your Answer