Where is mongo database folder on the filesystem
up vote
4
down vote
favorite
I'm using Ubuntu 16.04. I have set up a database MongoDB
. When I start it (with mongod
command) it says that database is located at /data/db
(dbpath=/data/db
).
The database works fine. But in files explorer I cannot find that folder. I've looked in Computer
folder and in Home
(Computer/home/<my name>
) folder.
I also showed hidden files and folders with Ctrl+H.
How can I find my database folder?
16.04 files filesystem database mongodb
add a comment |
up vote
4
down vote
favorite
I'm using Ubuntu 16.04. I have set up a database MongoDB
. When I start it (with mongod
command) it says that database is located at /data/db
(dbpath=/data/db
).
The database works fine. But in files explorer I cannot find that folder. I've looked in Computer
folder and in Home
(Computer/home/<my name>
) folder.
I also showed hidden files and folders with Ctrl+H.
How can I find my database folder?
16.04 files filesystem database mongodb
add a comment |
up vote
4
down vote
favorite
up vote
4
down vote
favorite
I'm using Ubuntu 16.04. I have set up a database MongoDB
. When I start it (with mongod
command) it says that database is located at /data/db
(dbpath=/data/db
).
The database works fine. But in files explorer I cannot find that folder. I've looked in Computer
folder and in Home
(Computer/home/<my name>
) folder.
I also showed hidden files and folders with Ctrl+H.
How can I find my database folder?
16.04 files filesystem database mongodb
I'm using Ubuntu 16.04. I have set up a database MongoDB
. When I start it (with mongod
command) it says that database is located at /data/db
(dbpath=/data/db
).
The database works fine. But in files explorer I cannot find that folder. I've looked in Computer
folder and in Home
(Computer/home/<my name>
) folder.
I also showed hidden files and folders with Ctrl+H.
How can I find my database folder?
16.04 files filesystem database mongodb
16.04 files filesystem database mongodb
edited Dec 3 '17 at 8:35
Yaron
8,74871939
8,74871939
asked Dec 3 '17 at 7:52
croraf
123114
123114
add a comment |
add a comment |
3 Answers
3
active
oldest
votes
up vote
3
down vote
You should be able to find the location in the configuration file: /etc/mongod.conf
grep dbPath /etc/mongod.conf
According to mongodb docs:
The default path is /data/db
directory
By default, MongoDB listens for connections from clients on port
27017, and stores data in the /data/db directory.
If dbPath
is set, the mongodb will use the directory specify by dbPath
If you want
mongod
to store data files at a path other than/data/db
you can specify adbPath
. ThedbPath
must exist before you start
mongod
. If it does not exist, create the directory and the permissions
so thatmongod
can read and write data to this path. For more
information on permissions, see the security operations documentation.
I found /etc/mongod.conf (notice there is no 'b' letter). There it says: storage: dbPath: /var/lib/mongodb. And that folder looks like it could be the database. Also the variable is dbPath (uppercase 'P'). But then why the hell when I start mongod it says dbpath=/data/db?
– croraf
Dec 3 '17 at 8:00
@croraf - the/data/db
is the default value of the path, ifdbPath
is set, it override this value. Note that in order to use/data/db
as actual path, the folder should be exists and have the correct ownership/permissions. see updated answer with link to mongodb docs
– Yaron
Dec 3 '17 at 8:34
Thanks! The issue is mongod command outputs "MongoDB starting : pid=2722 port=27017 dbpath=/data/db 64-bit host=korisnik-Lenovo-Y520-15IKBN" indicating that dbpath is /data/db. Although this could be the default path the db starting command should indicate the actual path, in my case /var/lib/mongodb.
– croraf
Dec 3 '17 at 8:38
1
@croraf/etc/mongod.conf
configuration is only used if you Start MongoDB as a service or explicitly pass this on the command line:mongod --config /etc/mongod.conf
. If you startmongod
without any options the default of/data/db
will be used. If you startmongod
as a service on Ubuntu,dbPath
will be as specified in/etc/mongod.conf
(/var/lib/mongodb
by default). Typically you want to be managing MongoDB as a service to ensure consistent configuration is used between invocations.
– Stennie
Dec 4 '17 at 3:19
@Stennie Yes it seems mongod is started on OS boot (what you call 'as a service'). This was confusing me. I will check today but probably running mongod gives error that the port is already bound.
– croraf
Dec 4 '17 at 9:20
add a comment |
up vote
0
down vote
That's because the "root" that you are seeing, is not the real root, its the root of your home, on the File explorer, when you are on your 'root' home page, press backspace
to go to the parent folder.
add a comment |
up vote
-1
down vote
Try typing file:///data/db/
in the browser (chrome or fire-fox). You'll be able to see the files and collections if you have mongodb
installed in system, but all would be encrypted you cannot read them in an editor.
add a comment |
3 Answers
3
active
oldest
votes
3 Answers
3
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
3
down vote
You should be able to find the location in the configuration file: /etc/mongod.conf
grep dbPath /etc/mongod.conf
According to mongodb docs:
The default path is /data/db
directory
By default, MongoDB listens for connections from clients on port
27017, and stores data in the /data/db directory.
If dbPath
is set, the mongodb will use the directory specify by dbPath
If you want
mongod
to store data files at a path other than/data/db
you can specify adbPath
. ThedbPath
must exist before you start
mongod
. If it does not exist, create the directory and the permissions
so thatmongod
can read and write data to this path. For more
information on permissions, see the security operations documentation.
I found /etc/mongod.conf (notice there is no 'b' letter). There it says: storage: dbPath: /var/lib/mongodb. And that folder looks like it could be the database. Also the variable is dbPath (uppercase 'P'). But then why the hell when I start mongod it says dbpath=/data/db?
– croraf
Dec 3 '17 at 8:00
@croraf - the/data/db
is the default value of the path, ifdbPath
is set, it override this value. Note that in order to use/data/db
as actual path, the folder should be exists and have the correct ownership/permissions. see updated answer with link to mongodb docs
– Yaron
Dec 3 '17 at 8:34
Thanks! The issue is mongod command outputs "MongoDB starting : pid=2722 port=27017 dbpath=/data/db 64-bit host=korisnik-Lenovo-Y520-15IKBN" indicating that dbpath is /data/db. Although this could be the default path the db starting command should indicate the actual path, in my case /var/lib/mongodb.
– croraf
Dec 3 '17 at 8:38
1
@croraf/etc/mongod.conf
configuration is only used if you Start MongoDB as a service or explicitly pass this on the command line:mongod --config /etc/mongod.conf
. If you startmongod
without any options the default of/data/db
will be used. If you startmongod
as a service on Ubuntu,dbPath
will be as specified in/etc/mongod.conf
(/var/lib/mongodb
by default). Typically you want to be managing MongoDB as a service to ensure consistent configuration is used between invocations.
– Stennie
Dec 4 '17 at 3:19
@Stennie Yes it seems mongod is started on OS boot (what you call 'as a service'). This was confusing me. I will check today but probably running mongod gives error that the port is already bound.
– croraf
Dec 4 '17 at 9:20
add a comment |
up vote
3
down vote
You should be able to find the location in the configuration file: /etc/mongod.conf
grep dbPath /etc/mongod.conf
According to mongodb docs:
The default path is /data/db
directory
By default, MongoDB listens for connections from clients on port
27017, and stores data in the /data/db directory.
If dbPath
is set, the mongodb will use the directory specify by dbPath
If you want
mongod
to store data files at a path other than/data/db
you can specify adbPath
. ThedbPath
must exist before you start
mongod
. If it does not exist, create the directory and the permissions
so thatmongod
can read and write data to this path. For more
information on permissions, see the security operations documentation.
I found /etc/mongod.conf (notice there is no 'b' letter). There it says: storage: dbPath: /var/lib/mongodb. And that folder looks like it could be the database. Also the variable is dbPath (uppercase 'P'). But then why the hell when I start mongod it says dbpath=/data/db?
– croraf
Dec 3 '17 at 8:00
@croraf - the/data/db
is the default value of the path, ifdbPath
is set, it override this value. Note that in order to use/data/db
as actual path, the folder should be exists and have the correct ownership/permissions. see updated answer with link to mongodb docs
– Yaron
Dec 3 '17 at 8:34
Thanks! The issue is mongod command outputs "MongoDB starting : pid=2722 port=27017 dbpath=/data/db 64-bit host=korisnik-Lenovo-Y520-15IKBN" indicating that dbpath is /data/db. Although this could be the default path the db starting command should indicate the actual path, in my case /var/lib/mongodb.
– croraf
Dec 3 '17 at 8:38
1
@croraf/etc/mongod.conf
configuration is only used if you Start MongoDB as a service or explicitly pass this on the command line:mongod --config /etc/mongod.conf
. If you startmongod
without any options the default of/data/db
will be used. If you startmongod
as a service on Ubuntu,dbPath
will be as specified in/etc/mongod.conf
(/var/lib/mongodb
by default). Typically you want to be managing MongoDB as a service to ensure consistent configuration is used between invocations.
– Stennie
Dec 4 '17 at 3:19
@Stennie Yes it seems mongod is started on OS boot (what you call 'as a service'). This was confusing me. I will check today but probably running mongod gives error that the port is already bound.
– croraf
Dec 4 '17 at 9:20
add a comment |
up vote
3
down vote
up vote
3
down vote
You should be able to find the location in the configuration file: /etc/mongod.conf
grep dbPath /etc/mongod.conf
According to mongodb docs:
The default path is /data/db
directory
By default, MongoDB listens for connections from clients on port
27017, and stores data in the /data/db directory.
If dbPath
is set, the mongodb will use the directory specify by dbPath
If you want
mongod
to store data files at a path other than/data/db
you can specify adbPath
. ThedbPath
must exist before you start
mongod
. If it does not exist, create the directory and the permissions
so thatmongod
can read and write data to this path. For more
information on permissions, see the security operations documentation.
You should be able to find the location in the configuration file: /etc/mongod.conf
grep dbPath /etc/mongod.conf
According to mongodb docs:
The default path is /data/db
directory
By default, MongoDB listens for connections from clients on port
27017, and stores data in the /data/db directory.
If dbPath
is set, the mongodb will use the directory specify by dbPath
If you want
mongod
to store data files at a path other than/data/db
you can specify adbPath
. ThedbPath
must exist before you start
mongod
. If it does not exist, create the directory and the permissions
so thatmongod
can read and write data to this path. For more
information on permissions, see the security operations documentation.
edited Dec 3 '17 at 8:32
answered Dec 3 '17 at 7:56
Yaron
8,74871939
8,74871939
I found /etc/mongod.conf (notice there is no 'b' letter). There it says: storage: dbPath: /var/lib/mongodb. And that folder looks like it could be the database. Also the variable is dbPath (uppercase 'P'). But then why the hell when I start mongod it says dbpath=/data/db?
– croraf
Dec 3 '17 at 8:00
@croraf - the/data/db
is the default value of the path, ifdbPath
is set, it override this value. Note that in order to use/data/db
as actual path, the folder should be exists and have the correct ownership/permissions. see updated answer with link to mongodb docs
– Yaron
Dec 3 '17 at 8:34
Thanks! The issue is mongod command outputs "MongoDB starting : pid=2722 port=27017 dbpath=/data/db 64-bit host=korisnik-Lenovo-Y520-15IKBN" indicating that dbpath is /data/db. Although this could be the default path the db starting command should indicate the actual path, in my case /var/lib/mongodb.
– croraf
Dec 3 '17 at 8:38
1
@croraf/etc/mongod.conf
configuration is only used if you Start MongoDB as a service or explicitly pass this on the command line:mongod --config /etc/mongod.conf
. If you startmongod
without any options the default of/data/db
will be used. If you startmongod
as a service on Ubuntu,dbPath
will be as specified in/etc/mongod.conf
(/var/lib/mongodb
by default). Typically you want to be managing MongoDB as a service to ensure consistent configuration is used between invocations.
– Stennie
Dec 4 '17 at 3:19
@Stennie Yes it seems mongod is started on OS boot (what you call 'as a service'). This was confusing me. I will check today but probably running mongod gives error that the port is already bound.
– croraf
Dec 4 '17 at 9:20
add a comment |
I found /etc/mongod.conf (notice there is no 'b' letter). There it says: storage: dbPath: /var/lib/mongodb. And that folder looks like it could be the database. Also the variable is dbPath (uppercase 'P'). But then why the hell when I start mongod it says dbpath=/data/db?
– croraf
Dec 3 '17 at 8:00
@croraf - the/data/db
is the default value of the path, ifdbPath
is set, it override this value. Note that in order to use/data/db
as actual path, the folder should be exists and have the correct ownership/permissions. see updated answer with link to mongodb docs
– Yaron
Dec 3 '17 at 8:34
Thanks! The issue is mongod command outputs "MongoDB starting : pid=2722 port=27017 dbpath=/data/db 64-bit host=korisnik-Lenovo-Y520-15IKBN" indicating that dbpath is /data/db. Although this could be the default path the db starting command should indicate the actual path, in my case /var/lib/mongodb.
– croraf
Dec 3 '17 at 8:38
1
@croraf/etc/mongod.conf
configuration is only used if you Start MongoDB as a service or explicitly pass this on the command line:mongod --config /etc/mongod.conf
. If you startmongod
without any options the default of/data/db
will be used. If you startmongod
as a service on Ubuntu,dbPath
will be as specified in/etc/mongod.conf
(/var/lib/mongodb
by default). Typically you want to be managing MongoDB as a service to ensure consistent configuration is used between invocations.
– Stennie
Dec 4 '17 at 3:19
@Stennie Yes it seems mongod is started on OS boot (what you call 'as a service'). This was confusing me. I will check today but probably running mongod gives error that the port is already bound.
– croraf
Dec 4 '17 at 9:20
I found /etc/mongod.conf (notice there is no 'b' letter). There it says: storage: dbPath: /var/lib/mongodb. And that folder looks like it could be the database. Also the variable is dbPath (uppercase 'P'). But then why the hell when I start mongod it says dbpath=/data/db?
– croraf
Dec 3 '17 at 8:00
I found /etc/mongod.conf (notice there is no 'b' letter). There it says: storage: dbPath: /var/lib/mongodb. And that folder looks like it could be the database. Also the variable is dbPath (uppercase 'P'). But then why the hell when I start mongod it says dbpath=/data/db?
– croraf
Dec 3 '17 at 8:00
@croraf - the
/data/db
is the default value of the path, if dbPath
is set, it override this value. Note that in order to use /data/db
as actual path, the folder should be exists and have the correct ownership/permissions. see updated answer with link to mongodb docs– Yaron
Dec 3 '17 at 8:34
@croraf - the
/data/db
is the default value of the path, if dbPath
is set, it override this value. Note that in order to use /data/db
as actual path, the folder should be exists and have the correct ownership/permissions. see updated answer with link to mongodb docs– Yaron
Dec 3 '17 at 8:34
Thanks! The issue is mongod command outputs "MongoDB starting : pid=2722 port=27017 dbpath=/data/db 64-bit host=korisnik-Lenovo-Y520-15IKBN" indicating that dbpath is /data/db. Although this could be the default path the db starting command should indicate the actual path, in my case /var/lib/mongodb.
– croraf
Dec 3 '17 at 8:38
Thanks! The issue is mongod command outputs "MongoDB starting : pid=2722 port=27017 dbpath=/data/db 64-bit host=korisnik-Lenovo-Y520-15IKBN" indicating that dbpath is /data/db. Although this could be the default path the db starting command should indicate the actual path, in my case /var/lib/mongodb.
– croraf
Dec 3 '17 at 8:38
1
1
@croraf
/etc/mongod.conf
configuration is only used if you Start MongoDB as a service or explicitly pass this on the command line: mongod --config /etc/mongod.conf
. If you start mongod
without any options the default of /data/db
will be used. If you start mongod
as a service on Ubuntu, dbPath
will be as specified in /etc/mongod.conf
(/var/lib/mongodb
by default). Typically you want to be managing MongoDB as a service to ensure consistent configuration is used between invocations.– Stennie
Dec 4 '17 at 3:19
@croraf
/etc/mongod.conf
configuration is only used if you Start MongoDB as a service or explicitly pass this on the command line: mongod --config /etc/mongod.conf
. If you start mongod
without any options the default of /data/db
will be used. If you start mongod
as a service on Ubuntu, dbPath
will be as specified in /etc/mongod.conf
(/var/lib/mongodb
by default). Typically you want to be managing MongoDB as a service to ensure consistent configuration is used between invocations.– Stennie
Dec 4 '17 at 3:19
@Stennie Yes it seems mongod is started on OS boot (what you call 'as a service'). This was confusing me. I will check today but probably running mongod gives error that the port is already bound.
– croraf
Dec 4 '17 at 9:20
@Stennie Yes it seems mongod is started on OS boot (what you call 'as a service'). This was confusing me. I will check today but probably running mongod gives error that the port is already bound.
– croraf
Dec 4 '17 at 9:20
add a comment |
up vote
0
down vote
That's because the "root" that you are seeing, is not the real root, its the root of your home, on the File explorer, when you are on your 'root' home page, press backspace
to go to the parent folder.
add a comment |
up vote
0
down vote
That's because the "root" that you are seeing, is not the real root, its the root of your home, on the File explorer, when you are on your 'root' home page, press backspace
to go to the parent folder.
add a comment |
up vote
0
down vote
up vote
0
down vote
That's because the "root" that you are seeing, is not the real root, its the root of your home, on the File explorer, when you are on your 'root' home page, press backspace
to go to the parent folder.
That's because the "root" that you are seeing, is not the real root, its the root of your home, on the File explorer, when you are on your 'root' home page, press backspace
to go to the parent folder.
answered Nov 28 at 16:30
Carlos Villalta
11
11
add a comment |
add a comment |
up vote
-1
down vote
Try typing file:///data/db/
in the browser (chrome or fire-fox). You'll be able to see the files and collections if you have mongodb
installed in system, but all would be encrypted you cannot read them in an editor.
add a comment |
up vote
-1
down vote
Try typing file:///data/db/
in the browser (chrome or fire-fox). You'll be able to see the files and collections if you have mongodb
installed in system, but all would be encrypted you cannot read them in an editor.
add a comment |
up vote
-1
down vote
up vote
-1
down vote
Try typing file:///data/db/
in the browser (chrome or fire-fox). You'll be able to see the files and collections if you have mongodb
installed in system, but all would be encrypted you cannot read them in an editor.
Try typing file:///data/db/
in the browser (chrome or fire-fox). You'll be able to see the files and collections if you have mongodb
installed in system, but all would be encrypted you cannot read them in an editor.
edited Sep 24 at 19:24
abu_bua
3,10081023
3,10081023
answered Sep 24 at 18:48
Deepu Rohilla
1
1
add a comment |
add a comment |
Thanks for contributing an answer to Ask Ubuntu!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f982673%2fwhere-is-mongo-database-folder-on-the-filesystem%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown