Test123
Test123

Reputation: 368

Mongo DB installation issue

I installed mongo DB by using docs of mongo DB. But when I tried this command in ubuntu terminal, I got this error:
Command used:

sudo mongod  

Error:

*********************************************************************
 ERROR: dbpath (/data/db) does not exist.
 Create this directory or give existing directory in --dbpath.
 See http://dochub.mongodb.org/core/startingandstoppingmongo
*********************************************************************  

How can I fix this error?

Upvotes: 0

Views: 188

Answers (4)

Purushottam Dike
Purushottam Dike

Reputation: 391

If you have created Test123 folder then

Run following command to restart the mongodb service

sudo service mongodb restart 

Then change the db for the mongodb Use following command

sudo mongod --dbpath Test123

Here Test123 is directory that you have created on specific location.

Upvotes: 0

Hrushikesh Kulkarni
Hrushikesh Kulkarni

Reputation: 1

Simple Mongo Setup on AWS Unbuntu 14.0 - By Hrushikesh Kulkarni

sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 7F0CEB10

echo 'deb http://downloads-distro.mongodb.org/repo/ubuntu-upstart dist 10gen' | sudo tee /etc/apt/sources.list.d/mongodb.list

sudo apt-get update sudo apt-get install -y mongodb-org sudo apt-get install php5 sudo apt-get install apache2 sudo apt-get install libsasl2-dev sudo apt-get install php-pear php5-dev sudo pecl install mongo

Add Below Stuff in /etc/php5/apache2/php.ini

extension_dir = "/usr/lib/php5/20121212" extension=mongo.so sudo service apache2 restart

Create php File in /var/www/html Run file in browser and find Extension "Mongo"

Upvotes: 0

Dolev Dori
Dolev Dori

Reputation: 1

If you installed mongo as a service (for example, using the following docs: http://docs.mongodb.org/manual/tutorial/install-mongodb-on-ubuntu/), simply execute:

sudo service mongod start

Otherwise, if you simply wish to try mongo without any specific configuration, you can supply a directory for the db files by executing:

mongod --dbpath /path/to/db &

Upvotes: 0

Kshitij Kulshrestha
Kshitij Kulshrestha

Reputation: 2072

Run this command to create a directory -

sudo mkdir /data/db

and then run

sudo mongod

Upvotes: 2

Related Questions